Class AutoloadedDriver
java.lang.Object
org.apache.derby.jdbc.AutoloadedDriver
- All Implemented Interfaces:
Driver
This is the dummy driver which is registered with the DriverManager and
which is autoloaded by JDBC4. Loading this class will NOT automatically
boot the Derby engine, but it will register this class as a valid
Driver with the DriverManager.
Instead, the engine boots lazily when you ask for a
Connection. Alternatively, you can force the engine to boot as follows:
Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
// or
new org.apache.derby.jdbc.EmbeddedDriver();
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static AutoloadedDriverprivate static Driverprivate static boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptsURL(String url) Accept anything that starts withjdbc:derby:.connect(String url, Properties info) Connect to the URL if possibleprivate static voidderegisterDriver(AutoloadedDriver driver) (package private) static Driver////////////////////////////////////////////////////////////////////intReturns the driver's major version number.intReturns the driver's minor version number./////////////////////////////////////////////////////////////////getPropertyInfo(String url, Properties info) Returns an array of DriverPropertyInfo objects describing possible properties.private static booleanisBooted()booleanReport whether the Driver is a genuine JDBC COMPLIANT (tm) driver.private static AutoloadedDriverLoad the most capable driver available.(package private) static voidregisterDriverModule(Driver driver) Record which driver module actually booted.protected static void(package private) static voidUnregister the driver and the AutoloadedDriver if exists.
-
Field Details
-
_engineForcedDown
private static boolean _engineForcedDown -
_autoloadedDriver
-
_driverModule
-
-
Constructor Details
-
AutoloadedDriver
public AutoloadedDriver()
-
-
Method Details
-
registerMe
-
acceptsURL
Accept anything that starts withjdbc:derby:.- Specified by:
acceptsURLin interfaceDriver- Throws:
SQLException- if a database-access error occurs.- See Also:
-
connect
Connect to the URL if possible- Specified by:
connectin interfaceDriver- Throws:
SQLException- illegal url or problem with connectiong- See Also:
-
getPropertyInfo
Returns an array of DriverPropertyInfo objects describing possible properties.- Specified by:
getPropertyInfoin interfaceDriver- Throws:
SQLException- if a database-access error occurs.- See Also:
-
getMajorVersion
public int getMajorVersion()Returns the driver's major version number.- Specified by:
getMajorVersionin interfaceDriver- See Also:
-
getMinorVersion
public int getMinorVersion()Returns the driver's minor version number.- Specified by:
getMinorVersionin interfaceDriver- See Also:
-
jdbcCompliant
public boolean jdbcCompliant()Report whether the Driver is a genuine JDBC COMPLIANT (tm) driver.- Specified by:
jdbcCompliantin interfaceDriver- See Also:
-
getParentLogger
/////////////////////////////////////////////////////////////////- Specified by:
getParentLoggerin interfaceDriver- Throws:
SQLFeatureNotSupportedException
-
getDriverModule
////////////////////////////////////////////////////////////////////- Throws:
SQLException
-
registerDriverModule
Record which driver module actually booted.- Parameters:
driver- the driver register to DriverManager is not AutoloadedDriver
-
unregisterDriverModule
static void unregisterDriverModule()Unregister the driver and the AutoloadedDriver if exists. This happens when the engine is forcibly shut down. -
deregisterDriver
- Throws:
SQLException
-
isBooted
private static boolean isBooted() -
makeAutoloadedDriver
Load the most capable driver available. But if the vm level doesn't support it, then we fall back on a lower-level driver.- Returns:
- AutoloadedDriver
-