|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.jdbc.InternalDriver
Abstract factory class and api for JDBC objects.
Field Summary | |
protected boolean |
active
|
private static InternalDriver |
activeDriver
|
private AuthenticationService |
authenticationService
|
private ContextService |
contextServiceFactory
|
private static java.lang.Object |
syncMe
|
Constructor Summary | |
InternalDriver()
|
Method Summary | |
boolean |
acceptsURL(java.lang.String url)
|
static InternalDriver |
activeDriver()
|
void |
boot(boolean create,
java.util.Properties properties)
Boot this module with the given properties. |
private static void |
checkBoolean(java.util.Properties set,
java.lang.String attribute)
|
private static void |
checkEnumeration(java.util.Properties set,
java.lang.String attribute,
java.lang.String[] choices)
|
java.sql.Connection |
connect(java.lang.String url,
java.util.Properties info)
|
protected FormatableProperties |
getAttributes(java.lang.String url,
java.util.Properties info)
Convert all the attributes in the url into properties and combine them with the set provided. |
AuthenticationService |
getAuthenticationService()
|
private ConnectionContext |
getConnectionContext()
|
ContextService |
getContextServiceFactory()
|
private ContextManager |
getCurrentContextManager()
|
static java.lang.String |
getDatabaseName(java.lang.String url,
java.util.Properties info)
Get the database name from the url. |
int |
getMajorVersion()
|
int |
getMinorVersion()
|
protected abstract EmbedConnection |
getNewEmbedConnection(java.lang.String url,
java.util.Properties info)
|
abstract java.sql.Connection |
getNewNestedConnection(EmbedConnection conn)
Get a new nested connection. |
boolean |
isActive()
Return true if this driver is active. |
boolean |
jdbcCompliant()
|
abstract java.sql.CallableStatement |
newEmbedCallableStatement(EmbedConnection conn,
java.lang.String stmt,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
|
java.sql.DatabaseMetaData |
newEmbedDatabaseMetaData(EmbedConnection conn,
java.lang.String dbname)
Return a new java.sql.DatabaseMetaData instance for this implementation. |
abstract java.sql.PreparedStatement |
newEmbedPreparedStatement(EmbedConnection conn,
java.lang.String stmt,
boolean forMetaData,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability,
int autoGeneratedKeys,
int[] columnIndexes,
java.lang.String[] columnNames)
|
abstract EmbedResultSet |
newEmbedResultSet(EmbedConnection conn,
ResultSet results,
boolean forMetaData,
EmbedStatement statement,
boolean isAtomic)
Return a new java.sql.ResultSet instance for this implementation. |
java.sql.Statement |
newEmbedStatement(EmbedConnection conn,
boolean forMetaData,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
|
void |
stop()
Stop the module. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.Object syncMe
private static InternalDriver activeDriver
protected boolean active
private ContextService contextServiceFactory
private AuthenticationService authenticationService
Constructor Detail |
public InternalDriver()
Method Detail |
public static final InternalDriver activeDriver()
public void boot(boolean create, java.util.Properties properties) throws StandardException
ModuleControl
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.
Typically the properties object contains one or more default
properties sets, which are not written out to service.properties.
These default sets are how callers modify the create process. In a
JDBC connection database create the first set of defaults is a properties
object that contains the attributes that were set on the jdbc:derby: URL.
This attributes properties set has the second default properties set as
its default. This set (which could be null) contains the properties
that the user set on their DriverManager.getConnection() call, and are thus
not owned by cloudscape code, and thus must not be modified by cloudscape
code.
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.
boot
in interface ModuleControl
StandardException
- Module cannot be started.Monitor
,
ModuleFactory
public void stop()
ModuleControl
stop
in interface ModuleControl
Monitor
,
ModuleFactory
public boolean acceptsURL(java.lang.String url)
public java.sql.Connection connect(java.lang.String url, java.util.Properties info) throws java.sql.SQLException
java.sql.SQLException
public int getMajorVersion()
public int getMinorVersion()
public boolean jdbcCompliant()
protected FormatableProperties getAttributes(java.lang.String url, java.util.Properties info) throws java.sql.SQLException
java.sql.SQLException
- thrown if URL form badprivate static void checkBoolean(java.util.Properties set, java.lang.String attribute) throws java.sql.SQLException
java.sql.SQLException
private static void checkEnumeration(java.util.Properties set, java.lang.String attribute, java.lang.String[] choices) throws java.sql.SQLException
java.sql.SQLException
public static java.lang.String getDatabaseName(java.lang.String url, java.util.Properties info)
url
- The url being used for the connectioninfo
- The properties set being used for the connection, must include
the properties derived from the attributes in the url
public final ContextService getContextServiceFactory()
public AuthenticationService getAuthenticationService()
protected abstract EmbedConnection getNewEmbedConnection(java.lang.String url, java.util.Properties info) throws java.sql.SQLException
java.sql.SQLException
private ConnectionContext getConnectionContext()
private ContextManager getCurrentContextManager()
public boolean isActive()
public abstract java.sql.Connection getNewNestedConnection(EmbedConnection conn)
conn
- The EmbedConnection.
public java.sql.Statement newEmbedStatement(EmbedConnection conn, boolean forMetaData, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
public abstract java.sql.PreparedStatement newEmbedPreparedStatement(EmbedConnection conn, java.lang.String stmt, boolean forMetaData, int resultSetType, int resultSetConcurrency, int resultSetHoldability, int autoGeneratedKeys, int[] columnIndexes, java.lang.String[] columnNames) throws java.sql.SQLException
java.sql.SQLException
- if fails to create statementpublic abstract java.sql.CallableStatement newEmbedCallableStatement(EmbedConnection conn, java.lang.String stmt, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
java.sql.SQLException
- if fails to create statementpublic java.sql.DatabaseMetaData newEmbedDatabaseMetaData(EmbedConnection conn, java.lang.String dbname) throws java.sql.SQLException
java.sql.SQLException
- on failure to create.public abstract EmbedResultSet newEmbedResultSet(EmbedConnection conn, ResultSet results, boolean forMetaData, EmbedStatement statement, boolean isAtomic) throws java.sql.SQLException
conn
- Owning connectionresults
- Top level of language result set treeforMetaData
- Is this for meta-datastatement
- The statement that is creating the SQL ResultSetisAtomic
-
java.sql.SQLException
|
Built on Mon 2007-06-04 09:58:47+0400, from revision ??? | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |