Package com.mckoi.database.jdbc
Class MDriver
- java.lang.Object
-
- com.mckoi.database.jdbc.MDriver
-
- All Implemented Interfaces:
java.sql.Driver
- Direct Known Subclasses:
JDBCDriver
public class MDriver extends java.lang.Object implements java.sql.Driver
JDBC implementation of the driver for the Mckoi database.The url protocol is as follows:
For connecting to a remote database server: jdbc:mckoi:[//hostname[:portnum]/][schema_name/] eg. jdbc:mckoi://db.mckoi.com:7009/ If hostname is not provided then it defaults to localhost. If portnum is not provided it defaults to 9157. If schema_name is not provided it defaults to APP. To start up a database in the local file system the protocol is: jdbc:mckoi:local://databaseconfiguration/[schema_name/] eg. jdbc:mckoi:local://D:/dbdata/db.conf If schema_name is not provided it defaults to APP. To create a database in the local file system then you need to supply a 'create=true' assignment in the URL encoding. eg. jdbc:mckoi:local://D:/dbdata/db.conf?create=true
A local database runs within the JVM of this JDBC driver. To boot a local database, you must include the full database .jar release with your application distribution.
For connecting to a remote database using the remote URL string, only the JDBC driver need be included in the classpath.
NOTE: This needs to be a light-weight object, because a developer could generate multiple instances of this class. Making an instance of 'com.mckoi.JDBCDriver' will create at least two instances of this object.
- Author:
- Tobias Downer
-
-
Constructor Summary
Constructors Constructor Description MDriver()
Constructor is public so that instances of the JDBC driver can be created by developers.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
acceptsURL(java.lang.String url)
java.sql.Connection
connect(java.lang.String url, java.util.Properties info)
int
getMajorVersion()
int
getMinorVersion()
java.util.logging.Logger
getParentLogger()
java.sql.DriverPropertyInfo[]
getPropertyInfo(java.lang.String url, java.util.Properties info)
boolean
jdbcCompliant()
static void
register()
Static method that registers this driver with the JDBC driver manager.
-
-
-
Method Detail
-
register
public static void register()
Static method that registers this driver with the JDBC driver manager.
-
connect
public java.sql.Connection connect(java.lang.String url, java.util.Properties info) throws java.sql.SQLException
- Specified by:
connect
in interfacejava.sql.Driver
- Throws:
java.sql.SQLException
-
acceptsURL
public boolean acceptsURL(java.lang.String url) throws java.sql.SQLException
- Specified by:
acceptsURL
in interfacejava.sql.Driver
- Throws:
java.sql.SQLException
-
getPropertyInfo
public java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String url, java.util.Properties info) throws java.sql.SQLException
- Specified by:
getPropertyInfo
in interfacejava.sql.Driver
- Throws:
java.sql.SQLException
-
getMajorVersion
public int getMajorVersion()
- Specified by:
getMajorVersion
in interfacejava.sql.Driver
-
getMinorVersion
public int getMinorVersion()
- Specified by:
getMinorVersion
in interfacejava.sql.Driver
-
jdbcCompliant
public boolean jdbcCompliant()
- Specified by:
jdbcCompliant
in interfacejava.sql.Driver
-
getParentLogger
public java.util.logging.Logger getParentLogger() throws java.sql.SQLFeatureNotSupportedException
- Specified by:
getParentLogger
in interfacejava.sql.Driver
- Throws:
java.sql.SQLFeatureNotSupportedException
-
-