| Modifier and Type | Class and Description |
|---|---|
| private static class | InternalDriver.
Thread factory to produce daemon threads which don't block VM shutdown. |
| public static class | InternalDriver.
This code is called in a thread which puts time limits on it. |
| Modifier and Type | Field and Description |
|---|---|
| private static final ExecutorService | _executorPool
An executor service used for executing connection attempts when a login timeout has been specified. |
| protected boolean | |
| private static InternalDriver | |
| private AuthenticationService | |
| private static final String[] | |
| private ContextService | |
| private static boolean | deregister
Tells whether or not |
| private Object | |
| private static final Object |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | acceptsURL(String
the URL of the database url)Implements java. Retrieves whether the driver thinks that it can open a connection to the given URL. |
| public static final InternalDriver | |
| public void | boot(boolean
True if the database should be created create, Properties Configuration properties properties)Implements org. Boot this module with the given properties. |
| private static void | |
| private static void | |
| private void | checkShutdownPrivileges(String
The user to be checked for shutdown privileges user)Checks for shutdown System Privileges. |
| public void | checkSystemPrivileges(String
The user to be checked for having the permission user, Permission The permission to be checked perm)Checks for System Privileges. |
| public Connection | |
| 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. Attempts to make a database connection to the given URL. |
| public static boolean | |
| private static Object | findService(final String factoryInterface, final String serviceName)
Must be private so that user code can't call this entry point. |
| protected FormatableProperties | Returns: a Derby properties objectThe properties-bearing URL url, Properties Existing properties info)Convert all the attributes in the url into properties and combine them with the set provided. |
| public AuthenticationService | |
| private ConnectionContext | |
| private static ContextService | |
| public final ContextService | |
| private ContextManager | |
| public static String | Returns: a String containing the database name or an empty string ("") if no database name is present in the URL.The url being used for the connection url, Properties The properties set being used for the connection, must include
the properties derived from the attributes in the url info)Get the database name from the url. |
| public static boolean | Returns: the deregister valueCheck whether |
| public int | getMajorVersion()
Implements java. Retrieves the driver's major version number. |
| public int | getMinorVersion()
Implements java. Gets the driver's minor version number. |
| private static ModuleFactory | |
| pack-priv EmbedConnection | |
| public Connection | Returns: A nested connection object.The EmbedConnection. conn)Get a new nested connection. |
| public Logger | getParentLogger()
Implements java. Return the parent Logger of all the Loggers used by this driver. |
| public DriverPropertyInfo[] | Returns: An array of DriverPropertyInfo objects describing possible properties. This array may be an empty array if no properties are required.The URL of the database to connect to. url, Properties A proposed list of tag/value pairs that will be sent on
connect open. info)Implements java. The getPropertyInfo method is intended to allow a generic GUI tool to discover what properties it should prompt a human for in order to get enough information to connect to a database. |
| private static Object | getSystemModule(final String factoryInterface)
Must be private so that user code can't call this entry point. |
| public boolean | |
| public boolean | jdbcCompliant()
Implements java. Reports whether this driver is a genuine JDBC Compliant driver. |
| public BrokeredConnection | Returns: a brokered connectionControl variable control)Return a new BrokeredConnection for this implementation. |
| public CallableStatement | Returns: a CallableStatementDerby connection conn, String Statement text stmt, int Type of ResultSet resultSetType, int Concurrency setting resultSetConcurrency, int Holdability setting resultSetHoldability)
|
| public DatabaseMetaData | Returns: a new java.sql.DatabaseMetaData instance for this implementationDerby connection conn, String Database name dbname)Return a new java.sql.DatabaseMetaData instance for this implementation. |
| public PreparedStatement | Returns: a PreparedStatementDerby connection conn, String Statement text stmt, boolean True if this is for metadata forMetaData, int Type of ResultSet resultSetType, int Concurrency setting resultSetConcurrency, int Holdability setting resultSetHoldability, int The autogenerated keys autoGeneratedKeys, int[] Column positions columnIndexes, String[] The column names columnNames)
|
| public EmbedResultSet | Returns: a new java.sql.ResultSetOwning connection conn, ResultSet Top level of language result set tree results, boolean Is this for meta-data forMetaData, EmbedStatement The statement that is creating the SQL ResultSet statement, boolean True if the ResultSet is atomic isAtomic)Return a new java.sql.ResultSet instance for this implementation. |
| public EmbedResultSetMetaData | Returns: ResultSet metadataa ResultColumnDescriptor that stores information
about the columns in a ResultSet columnInfo)Returns a new java.sql.ResultSetMetaData for this implementation |
| public Statement | newEmbedStatement(EmbedConnection conn, boolean forMetaData, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
|
| private SQLException | |
| public static void | setDeregister(boolean
whether or not deregister)AutoloadedDriver should
deregister itselfIndicate to |
| public void | |
| private EmbedConnection |
| _executorPool | back to summary |
|---|---|
| private static final ExecutorService _executorPool An executor service used for executing connection attempts when a login timeout has been specified. DERBY-6107: Core pool size and keep alive timeout should be zero so that no threads are cached. By creating a fresh thread each time a task is submitted, we make sure that the task will run in a thread with the same context class loader as the thread that submitted the task. This is important for example when connecting to a database using the classpath subsubprotocol, and the database lives in the context class loader. If threads are cached, a task may execute in a thread that has a different context class loader. | |
| active | back to summary |
|---|---|
| protected boolean active | |
| activeDriver | back to summary |
|---|---|
| private static InternalDriver activeDriver | |
| authenticationService | back to summary |
|---|---|
| private AuthenticationService authenticationService | |
| BOOLEAN_CHOICES | back to summary |
|---|---|
| private static final String[] BOOLEAN_CHOICES | |
| contextServiceFactory | back to summary |
|---|---|
| private ContextService contextServiceFactory | |
| deregister | back to summary |
|---|---|
| private static boolean deregister Tells whether or not | |
| mbean | back to summary |
|---|---|
| private Object mbean | |
| syncMe | back to summary |
|---|---|
| private static final Object syncMe | |
| InternalDriver | back to summary |
|---|---|
| public InternalDriver() | |
| acceptsURL | back to summary |
|---|---|
| public boolean acceptsURL(String url) throws SQLException Implements java. Doc from java. Retrieves whether the driver thinks that it can open a connection
to the given URL. Typically drivers will return
| |
| activeDriver | back to summary |
|---|---|
| public static final InternalDriver activeDriver() | |
| boot | back to summary |
|---|---|
| public void boot(boolean create, Properties properties) throws StandardException Implements org. Doc from org. Boot this module with the given properties. Creates a module instance that can be found using the findModule() methods of Monitor. The module can only be found using one of these findModule() methods once this method has returned. An implementation's boot method can throw StandardException. If it is thrown the module is not registered by the monitor and therefore cannot be found through a findModule(). In this case the module's stop() method is not called, thus throwing this exception must free up any resources.
When create is true the contents of the properties object
will be written to the service.properties of the persistent
service. Thus any code that requires an entry in service.properties
must explicitly place the value in this properties set
using the put method.
When create is false the properties object contains all the properties set in the service.properties file plus a limited number of attributes from the JDBC URL attributes or connection properties set. This avoids properties set by the user compromising the boot process. An example of a property passed in from the JDBC world is the bootPassword for encrypted databases. Code should not hold onto the passed in properties reference after boot time as its contents may change underneath it. At least after the complete boot is completed, the links to all the default sets will be removed.
| |
| checkBoolean | back to summary |
|---|---|
| private static void checkBoolean(Properties set, String attribute) throws SQLException | |
| checkEnumeration | back to summary |
|---|---|
| private static void checkEnumeration(Properties set, String attribute, String[] choices) throws SQLException | |
| checkShutdownPrivileges | back to summary |
|---|---|
| private void checkShutdownPrivileges(String user) throws SQLException Checks for shutdown System Privileges. This is a NOP now because we have removed support for the SecurityManager. To perform this check the following policy grant is required
In addition, for the test to succeed
| |
| checkSystemPrivileges | back to summary |
|---|---|
| public void checkSystemPrivileges(String user, Permission perm) Checks for System Privileges.
| |
| connect | back to summary |
|---|---|
| public Connection connect(String url, Properties info, int loginTimeoutSeconds) throws SQLException | |
| connect | back to summary |
|---|---|
| public Connection connect(String url, Properties info) throws SQLException Implements java. Doc from java. Attempts to make a database connection to the given URL. The driver should return "null" if it realizes it is the wrong kind of driver to connect to the given URL. This will be common, as when the JDBC driver manager is asked to connect to a given URL it passes the URL to each loaded driver in turn. The driver should throw an The Note If a property is specified as part of the
| |
| embeddedDriverAcceptsURL | back to summary |
|---|---|
| public static boolean embeddedDriverAcceptsURL(String url) throws SQLException | |
| findService | back to summary |
|---|---|
| private static Object findService(final String factoryInterface, final String serviceName) Must be private so that user code can't call this entry point. | |
| getAttributes | back to summary |
|---|---|
| protected FormatableProperties getAttributes(String url, Properties info) throws SQLException Convert all the attributes in the url into properties and
combine them with the set provided.
| |
| getAuthenticationService | back to summary |
|---|---|
| public AuthenticationService getAuthenticationService() | |
| getConnectionContext | back to summary |
|---|---|
| private ConnectionContext getConnectionContext() | |
| getContextService | back to summary |
|---|---|
| private static ContextService getContextService() Must be private so that user code can't call this entry point. | |
| getContextServiceFactory | back to summary |
|---|---|
| public final ContextService getContextServiceFactory() | |
| getCurrentContextManager | back to summary |
|---|---|
| private ContextManager getCurrentContextManager() | |
| getDatabaseName | back to summary |
|---|---|
| public static String getDatabaseName(String url, Properties info) Get the database name from the url. Copes with three forms jdbc:derby:dbname jdbc:derby:dbname;... jdbc:derby:;subname=dbname
| |
| getDeregister | back to summary |
|---|---|
| public static boolean getDeregister() Check whether
| |
| getMajorVersion | back to summary |
|---|---|
| public int getMajorVersion() Implements java. Doc from java. Retrieves the driver's major version number. Initially this should be 1.
| |
| getMinorVersion | back to summary |
|---|---|
| public int getMinorVersion() Implements java. Doc from java. Gets the driver's minor version number. Initially this should be 0.
| |
| getMonitor | back to summary |
|---|---|
| private static ModuleFactory getMonitor() Must be private so that user code can't call this entry point. | |
| getNewEmbedConnection | back to summary |
|---|---|
| pack-priv EmbedConnection getNewEmbedConnection(final String url, final Properties info) throws SQLException | |
| getNewNestedConnection | back to summary |
|---|---|
| public Connection getNewNestedConnection(EmbedConnection conn) Get a new nested connection.
| |
| getParentLogger | back to summary |
|---|---|
| public Logger getParentLogger() throws SQLFeatureNotSupportedException Implements java. Doc from java. 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.
| |
| getPropertyInfo | back to summary |
|---|---|
| public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException Implements java. The getPropertyInfo method is intended to allow a generic GUI tool to discover what properties it should prompt a human for in order to get enough information to connect to a database. Note that depending on the values the human has supplied so far, additional values may become necessary, so it may be necessary to iterate though several calls to getPropertyInfo.
| |
| getSystemModule | back to summary |
|---|---|
| private static Object getSystemModule(final String factoryInterface) Must be private so that user code can't call this entry point. | |
| isActive | back to summary |
|---|---|
| public boolean isActive() Return true if this driver is active. Package private method.
| |
| jdbcCompliant | back to summary |
|---|---|
| public boolean jdbcCompliant() Implements java. Doc from java. Reports whether this driver is a genuine JDBC
Compliant driver.
A driver may only report JDBC compliance requires full support for the JDBC API and full support for SQL 92 Entry Level. It is expected that JDBC compliant drivers will be available for all the major commercial databases. This method is not intended to encourage the development of non-JDBC compliant drivers, but is a recognition of the fact that some vendors are interested in using the JDBC API and framework for lightweight databases that do not support full database functionality, or for special databases such as document information retrieval where a SQL implementation may not be feasible.
| |
| newBrokeredConnection | back to summary |
|---|---|
| public BrokeredConnection newBrokeredConnection(BrokeredConnectionControl control) throws SQLException Return a new BrokeredConnection for this implementation.
| |
| newEmbedCallableStatement | back to summary |
|---|---|
public CallableStatement newEmbedCallableStatement(EmbedConnection conn, String stmt, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
| |
| newEmbedDatabaseMetaData | back to summary |
|---|---|
| public DatabaseMetaData newEmbedDatabaseMetaData(EmbedConnection conn, String dbname) throws SQLException Return a new java.sql.DatabaseMetaData instance for this implementation.
| |
| newEmbedPreparedStatement | back to summary |
|---|---|
public PreparedStatement newEmbedPreparedStatement(EmbedConnection conn, String stmt, boolean forMetaData, int resultSetType, int resultSetConcurrency, int resultSetHoldability, int autoGeneratedKeys, int[] columnIndexes, String[] columnNames) throws SQLException
| |
| newEmbedResultSet | back to summary |
|---|---|
| public EmbedResultSet newEmbedResultSet(EmbedConnection conn, ResultSet results, boolean forMetaData, EmbedStatement statement, boolean isAtomic) throws SQLException Return a new java.sql.ResultSet instance for this implementation.
| |
| newEmbedResultSetMetaData | back to summary |
|---|---|
| public EmbedResultSetMetaData newEmbedResultSetMetaData(ResultColumnDescriptor[] columnInfo) Returns a new java.sql.ResultSetMetaData for this implementation
| |
| newEmbedStatement | back to summary |
|---|---|
| public Statement newEmbedStatement(EmbedConnection conn, boolean forMetaData, int resultSetType, int resultSetConcurrency, int resultSetHoldability) | |
| processException | back to summary |
|---|---|
| private SQLException processException(Throwable t) Process exceptions raised while running a timed login. | |
| setDeregister | back to summary |
|---|---|
| public static void setDeregister(boolean deregister) Indicate to
| |
| stop | back to summary |
|---|---|
| public void stop() Implements org. Doc from org. Stop the module. The module may be found via a findModule() method until some time after this method returns. Therefore the factory must be prepared to reject requests to it once it has been stopped. In addition other modules may cache a reference to the module and make requests of it after it has been stopped, these requests should be rejected as well. | |
| timeLogin | back to summary |
|---|---|
| private EmbedConnection timeLogin(String url, Properties info, int loginTimeoutSeconds) throws SQLException Enforce the login timeout. | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public Thread | newThread(Runnable
a runnable to be executed by new thread instance r)Implements java. Constructs a new unstarted |
| DaemonThreadFactory | back to summary |
|---|---|
| private DaemonThreadFactory() | |
| newThread | back to summary |
|---|---|
| public Thread newThread(Runnable r) Implements java. Doc from java. Constructs a new unstarted | |
| Modifier and Type | Field and Description |
|---|---|
| private InternalDriver | |
| private Properties | |
| private String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public EmbedConnection | call()
Implements java. Computes a result, or throws an exception if unable to do so. |
| _driver | back to summary |
|---|---|
| private InternalDriver _driver | |
| _info | back to summary |
|---|---|
| private Properties _info | |
| _url | back to summary |
|---|---|
| private String _url | |
| LoginCallable | back to summary |
|---|---|
| public LoginCallable(InternalDriver driver, String url, Properties info) | |
| call | back to summary |
|---|---|
| public EmbedConnection call() throws SQLException Implements java. Doc from java. Computes a result, or throws an exception if unable to do so.
| |