|
|||||||||
| Home >> All >> org >> apache >> derby >> [ jdbc overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.derby.jdbc
Class EmbeddedDriver

java.lang.Objectorg.apache.derby.jdbc.EmbeddedDriver
- All Implemented Interfaces:
- java.sql.Driver
- public class EmbeddedDriver
- extends java.lang.Object
- implements java.sql.Driver
- extends java.lang.Object
The embedded JDBC driver (Type 4) for Derby.
The driver automatically supports the correct JDBC specification version for the Java Virtual Machine's environment.
- JDBC 3.0 - Java 2 - JDK 1.4, J2SE 5.0
- JDBC 2.0 - Java 2 - JDK 1.2,1.3
Loading this JDBC driver boots the database engine within the same Java virtual machine.
The correct code to load the Derby 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 Derby 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 Derby 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 Derby JDBC driver.
| Constructor Summary | |
EmbeddedDriver()
|
|
| Method Summary | |
boolean |
acceptsURL(java.lang.String url)
Accept anything that starts with jdbc:derby:. |
private static void |
boot()
|
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. |
private java.sql.Driver |
getRegisteredDriver()
|
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 |
EmbeddedDriver
public EmbeddedDriver()
| Method Detail |
acceptsURL
public boolean acceptsURL(java.lang.String url) throws java.sql.SQLException
- Accept anything that starts with
jdbc:derby:.- Specified by:
acceptsURLin interfacejava.sql.Driver
connect
public java.sql.Connection connect(java.lang.String url, java.util.Properties info) throws java.sql.SQLException
- Connect to the URL if possible
- Specified by:
connectin interfacejava.sql.Driver
getPropertyInfo
public java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String url, java.util.Properties info) throws java.sql.SQLException
- Returns an array of DriverPropertyInfo objects describing possible properties.
- Specified by:
getPropertyInfoin interfacejava.sql.Driver
getMajorVersion
public int getMajorVersion()
- Returns the driver's major version number.
- Specified by:
getMajorVersionin interfacejava.sql.Driver
getMinorVersion
public int getMinorVersion()
- Returns the driver's minor version number.
- Specified by:
getMinorVersionin interfacejava.sql.Driver
jdbcCompliant
public boolean jdbcCompliant()
- Report whether the Driver is a genuine JDBC COMPLIANT (tm) driver.
- Specified by:
jdbcCompliantin interfacejava.sql.Driver
boot
private static void boot()
getRegisteredDriver
private java.sql.Driver getRegisteredDriver() throws java.sql.SQLException
|
|||||||||
| Home >> All >> org >> apache >> derby >> [ jdbc overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.apache.derby.jdbc.EmbeddedDriver