Package org.apache.derby.jdbc
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 AutoloadedDriver
private static Driver
private static boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
acceptsURL
(String url) Accept anything that starts withjdbc:derby:
.connect
(String url, Properties info) Connect to the URL if possibleprivate static void
deregisterDriver
(AutoloadedDriver driver) (package private) static Driver
int
Returns the driver's major version number.int
Returns the driver's minor version number.getPropertyInfo
(String url, Properties info) Returns an array of DriverPropertyInfo objects describing possible properties.private static boolean
isBooted()
boolean
Report whether the Driver is a genuine JDBC COMPLIANT (tm) driver.private static AutoloadedDriver
Load the most capable driver available.(package private) static void
registerDriverModule
(Driver driver) Record which driver module actually booted.protected static void
(package private) static void
Unregister 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:
acceptsURL
in interfaceDriver
- Throws:
SQLException
- if a database-access error occurs.- See Also:
-
connect
Connect to the URL if possible- Specified by:
connect
in interfaceDriver
- Throws:
SQLException
- illegal url or problem with connectiong- See Also:
-
getPropertyInfo
Returns an array of DriverPropertyInfo objects describing possible properties.- Specified by:
getPropertyInfo
in interfaceDriver
- Throws:
SQLException
- if a database-access error occurs.- See Also:
-
getMajorVersion
public int getMajorVersion()Returns the driver's major version number.- Specified by:
getMajorVersion
in interfaceDriver
- See Also:
-
getMinorVersion
public int getMinorVersion()Returns the driver's minor version number.- Specified by:
getMinorVersion
in interfaceDriver
- See Also:
-
jdbcCompliant
public boolean jdbcCompliant()Report whether the Driver is a genuine JDBC COMPLIANT (tm) driver.- Specified by:
jdbcCompliant
in interfaceDriver
- See Also:
-
getParentLogger
- Specified by:
getParentLogger
in 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
-