Top Description Fields Constructors Methods
org.apache.derby.iapi.jdbc

public Class AutoloadedDriver

extends Object
implements Driver
Class Inheritance
All Implemented Interfaces
java.sql.Driver
Imports
java.sql.DriverManager, .Driver, .Connection, .DriverPropertyInfo, .SQLException, .SQLFeatureNotSupportedException, java.util.Properties, java.util.logging.Logger, org.apache.derby.shared.common.reference.MessageId, .SQLState, org.apache.derby.shared.common.i18n.MessageService, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.services.monitor.Monitor, org.apache.derby.impl.jdbc.Util

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

Modifier and TypeField and Description
private static AutoloadedDriver
private static Driver
private static boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
acceptsURL(String
the URL of the database
url
)

Implements java.sql.Driver.acceptsURL.

Accept anything that starts with jdbc:derby:.

public Connection
connect(String
the URL of the database to which to connect
url
,
Properties
a list of arbitrary string tag/value pairs as connection arguments. Normally at least a "user" and "password" property should be included.
info
)

Implements java.sql.Driver.connect.

Connect to the URL if possible

private static void
public static Driver
public int
getMajorVersion()

Implements java.sql.Driver.getMajorVersion.

Returns the driver's major version number.

public int
getMinorVersion()

Implements java.sql.Driver.getMinorVersion.

Returns the driver's minor version number.

public Logger
getParentLogger()

Implements java.sql.Driver.getParentLogger.

Return the parent Logger of all the Loggers used by this driver.

public DriverPropertyInfo[]
getPropertyInfo(String
the URL of the database to which to connect
url
,
Properties
a proposed list of tag/value pairs that will be sent on connect open
info
)

Implements java.sql.Driver.getPropertyInfo.

Returns an array of DriverPropertyInfo objects describing possible properties.

private static boolean
public boolean
jdbcCompliant()

Implements java.sql.Driver.jdbcCompliant.

Report whether the Driver is a genuine JDBC COMPLIANT (tm) driver.

private static AutoloadedDriver

Returns:

AutoloadedDriver
makeAutoloadedDriver
()

Load the most capable driver available.

public static void
registerDriverModule(Driver
the driver register to DriverManager is not AutoloadedDriver
driver
)

Record which driver module actually booted.

protected static void
public static void
unregisterDriverModule()

Unregister the driver and the AutoloadedDriver if exists.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_autoloadedDriverback to summary
private static AutoloadedDriver _autoloadedDriver
_driverModuleback to summary
private static Driver _driverModule
_engineForcedDownback to summary
private static boolean _engineForcedDown

Constructor Detail

AutoloadedDriverback to summary
public AutoloadedDriver()

Method Detail

acceptsURLback to summary
public boolean acceptsURL(String url) throws SQLException

Implements java.sql.Driver.acceptsURL.

Accept anything that starts with jdbc:derby:.

Parameters
url:String

Doc from java.sql.Driver.acceptsURL.

the URL of the database

Returns:boolean

Doc from java.sql.Driver.acceptsURL.

true if this driver understands the given URL; false otherwise

Exceptions
SQLException:
if a database-access error occurs.
See Also
java.sql.Driver
connectback to summary
public Connection connect(String url, Properties info) throws SQLException

Implements java.sql.Driver.connect.

Connect to the URL if possible

Parameters
url:String

Doc from java.sql.Driver.connect.

the URL of the database to which to connect

info:Properties

Doc from java.sql.Driver.connect.

a list of arbitrary string tag/value pairs as connection arguments. Normally at least a "user" and "password" property should be included.

Returns:Connection

Doc from java.sql.Driver.connect.

a Connection object that represents a connection to the URL

Exceptions
SQLException:
illegal url or problem with connectiong
See Also
java.sql.Driver
deregisterDriverback to summary
private static void deregisterDriver(final AutoloadedDriver driver) throws SQLException
getDriverModuleback to summary
public static Driver getDriverModule() throws SQLException
getMajorVersionback to summary
public int getMajorVersion()

Implements java.sql.Driver.getMajorVersion.

Returns the driver's major version number.

Returns:int

Doc from java.sql.Driver.getMajorVersion.

this driver's major version number

See Also
java.sql.Driver
getMinorVersionback to summary
public int getMinorVersion()

Implements java.sql.Driver.getMinorVersion.

Returns the driver's minor version number.

Returns:int

Doc from java.sql.Driver.getMinorVersion.

this driver's minor version number

See Also
java.sql.Driver
getParentLoggerback to summary
public Logger getParentLogger() throws SQLFeatureNotSupportedException

Implements java.sql.Driver.getParentLogger.

Doc from java.sql.Driver.getParentLogger.

Return the parent Logger of all the Loggers used by this driver. This should be the Logger farthest from the root Logger that is still an ancestor of all of the Loggers used by this driver. Configuring this Logger will affect all of the log messages generated by the driver. In the worst case, this may be the root Logger.

Returns:Logger

the parent Logger for this driver

Exceptions
SQLFeatureNotSupportedException:
if the driver does not use java.util.logging.
getPropertyInfoback to summary
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException

Implements java.sql.Driver.getPropertyInfo.

Returns an array of DriverPropertyInfo objects describing possible properties.

Parameters
url:String

Doc from java.sql.Driver.getPropertyInfo.

the URL of the database to which to connect

info:Properties

Doc from java.sql.Driver.getPropertyInfo.

a proposed list of tag/value pairs that will be sent on connect open

Returns:DriverPropertyInfo[]

Doc from java.sql.Driver.getPropertyInfo.

an array of DriverPropertyInfo objects describing possible properties. This array may be an empty array if no properties are required.

Exceptions
SQLException:
if a database-access error occurs.
See Also
java.sql.Driver
isBootedback to summary
private static boolean isBooted()
jdbcCompliantback to summary
public boolean jdbcCompliant()

Implements java.sql.Driver.jdbcCompliant.

Report whether the Driver is a genuine JDBC COMPLIANT (tm) driver.

Returns:boolean

Doc from java.sql.Driver.jdbcCompliant.

true if this driver is JDBC Compliant; false otherwise

See Also
java.sql.Driver
makeAutoloadedDriverback to summary
private static AutoloadedDriver 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

AutoloadedDriver

registerDriverModuleback to summary
public static void registerDriverModule(Driver driver)

Record which driver module actually booted.

Parameters
driver:Driver

the driver register to DriverManager is not AutoloadedDriver

registerMeback to summary
protected static void registerMe(AutoloadedDriver me)
unregisterDriverModuleback to summary
public static void unregisterDriverModule()

Unregister the driver and the AutoloadedDriver if exists. This happens when the engine is forcibly shut down.