|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.derby.jdbc.EmbeddedDriver
The embedded JDBC driver (Type 4) for Cloudscape.
The driver automatically supports the correct JDBC specification version for the Java Virtual Machine's environment.
Loading this JDBC driver boots the database engine within the same Java virtual machine.
The correct code to load a Cloudscape engine using this driver is (with approriate try/catch blocks):
Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance(); // or new org.apache.derby.jdbc.EmbeddedDriver();When loaded in this way, the class boots the actual JDBC driver indirectly. The JDBC specification recommends the Class.ForName method without the .newInstance() method call, but adding the newInstance() guarantees that Cloudscape will be booted on any Java Virtual Machine.
Any initial error messages are placed in the PrintStream supplied by the DriverManager. If the PrintStream is null error messages are sent to System.err. Once the Cloudscape engine has set up an error logging facility (by default to derby.log) all subsequent messages are sent to it.
By convention, the class used in the Class.forName() method to boot a JDBC driver implements java.sql.Driver. This class is not the actual JDBC driver that gets registered with the Driver Manager. It proxies requests to the registered Cloudscape JDBC driver.
DriverManager
,
DriverManager.getLogStream()
,
Driver
,
SQLException
Constructor Summary | |
EmbeddedDriver()
|
Method Summary | |
boolean |
acceptsURL(java.lang.String url)
Accept anything that starts with jdbc:derby: . |
java.sql.Connection |
connect(java.lang.String url,
java.util.Properties info)
Connect to the URL if possible |
int |
getMajorVersion()
Returns the driver's major version number. |
int |
getMinorVersion()
Returns the driver's minor version number. |
java.sql.DriverPropertyInfo[] |
getPropertyInfo(java.lang.String url,
java.util.Properties info)
Returns an array of DriverPropertyInfo objects describing possible properties. |
boolean |
jdbcCompliant()
Report whether the Driver is a genuine JDBC COMPLIANT (tm) driver. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EmbeddedDriver()
Method Detail |
public boolean acceptsURL(java.lang.String url) throws java.sql.SQLException
jdbc:derby:
.
acceptsURL
in interface java.sql.Driver
java.sql.SQLException
- if a database-access error occurs.Driver
public java.sql.Connection connect(java.lang.String url, java.util.Properties info) throws java.sql.SQLException
connect
in interface java.sql.Driver
java.sql.SQLException
- illegal url or problem with connectiongDriver
public java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String url, java.util.Properties info) throws java.sql.SQLException
getPropertyInfo
in interface java.sql.Driver
java.sql.SQLException
- if a database-access error occurs.Driver
public int getMajorVersion()
getMajorVersion
in interface java.sql.Driver
Driver
public int getMinorVersion()
getMinorVersion
in interface java.sql.Driver
Driver
public boolean jdbcCompliant()
jdbcCompliant
in interface java.sql.Driver
Driver
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |