Package org.apache.derby.jdbc
Class ClientDriver
- java.lang.Object
-
- org.apache.derby.jdbc.ClientDriver
-
- All Implemented Interfaces:
java.sql.Driver
- Direct Known Subclasses:
ClientDriver40
public class ClientDriver extends java.lang.Object implements java.sql.DriverThe client JDBC driver (type 4) for Derby.
-
-
Field Summary
Fields Modifier and Type Field Description private static intDERBY_REMOTE_PROTOCOLprivate static java.sql.SQLExceptionexceptionsOnLoadDriver__private static ClientJDBCObjectFactoryfactoryObjectprivate static ClientDriverregisteredDriver__private inttraceFileSuffixIndex_
-
Constructor Summary
Constructors Constructor Description ClientDriver()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptsURL(java.lang.String url)private java.lang.StringappendDatabaseAttributes(java.lang.String database, java.util.Properties augmentedProperties)Append attributes to the database name except for user/password which are sent as part of the protocol, and SSL which is used locally in the client.private voidcheckURLNotNull(java.lang.String url)java.sql.Connectionconnect(java.lang.String url, java.util.Properties properties)private static ClientJDBCObjectFactorycreateDefaultFactoryImpl()Returns an instance of the ClientJDBCObjectFactoryImpl classprivate static ClientJDBCObjectFactorycreateJDBC40FactoryImpl()Returns an instance of the ClientJDBCObjectFactoryImpl40 class If a ClassNotFoundException occurs then it returns an instance of ClientJDBCObjectFactoryImpl If a future version of JDBC comes then a similar method would be added say createJDBCXXFactoryImpl in which if the class is not found then it would return the lower version thus having a sort of cascading effect until it gets a valid instanceprivate static ClientJDBCObjectFactorycreateJDBC42FactoryImpl()Returns an instance of the ClientJDBCObjectFactoryImpl42 class If a ClassNotFoundException occurs then it returns an instance of the most refined ClientJDBCObjectFactoryImpl possible If a future version of JDBC comes then a similar method would be added say createJDBCXXFactoryImpl in which if the class is not found then it would return the lower version thus having a sort of cascading effect until it gets a valid instancestatic ClientJDBCObjectFactorygetFactory()This method returns an Implementation of ClientJDBCObjectFactory depending on VM under use Currently it returns either ClientJDBCObjectFactoryImpl (or) ClientJDBCObjectFactoryImpl42intgetMajorVersion()intgetMinorVersion()java.util.logging.LoggergetParentLogger()java.sql.DriverPropertyInfo[]getPropertyInfo(java.lang.String url, java.util.Properties properties)booleanjdbcCompliant()protected static voidregisterMe(ClientDriver me)private static java.lang.StringtokenizeDatabase(java.util.StringTokenizer urlTokenizer, java.lang.String url)private static inttokenizeOptionalPortNumber(java.util.StringTokenizer urlTokenizer, java.lang.String url)private static inttokenizeProtocol(java.lang.String url, java.util.StringTokenizer urlTokenizer)private static java.lang.StringtokenizeServerName(java.util.StringTokenizer urlTokenizer, java.lang.String url)private static java.util.PropertiestokenizeURLProperties(java.lang.String url, java.util.Properties properties)
-
-
-
Field Detail
-
traceFileSuffixIndex_
private transient int traceFileSuffixIndex_
-
DERBY_REMOTE_PROTOCOL
private static final int DERBY_REMOTE_PROTOCOL
- See Also:
- Constant Field Values
-
factoryObject
private static ClientJDBCObjectFactory factoryObject
-
exceptionsOnLoadDriver__
private static java.sql.SQLException exceptionsOnLoadDriver__
-
registeredDriver__
private static ClientDriver registeredDriver__
-
-
Method Detail
-
registerMe
protected static void registerMe(ClientDriver me)
-
connect
public java.sql.Connection connect(java.lang.String url, java.util.Properties properties) throws java.sql.SQLException- Specified by:
connectin interfacejava.sql.Driver- Throws:
java.sql.SQLException
-
appendDatabaseAttributes
private java.lang.String appendDatabaseAttributes(java.lang.String database, java.util.Properties augmentedProperties)Append attributes to the database name except for user/password which are sent as part of the protocol, and SSL which is used locally in the client. Other attributes will be sent to the server with the database name Assumes augmentedProperties is not null- Parameters:
database- - Short database nameaugmentedProperties- - Set of properties to append as attributes- Returns:
- databaseName + attributes (e.g. mydb;create=true)
-
acceptsURL
public boolean acceptsURL(java.lang.String url) throws java.sql.SQLException- Specified by:
acceptsURLin interfacejava.sql.Driver- Throws:
java.sql.SQLException
-
checkURLNotNull
private void checkURLNotNull(java.lang.String url) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getPropertyInfo
public java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String url, java.util.Properties properties) throws java.sql.SQLException- Specified by:
getPropertyInfoin interfacejava.sql.Driver- Throws:
java.sql.SQLException
-
getMajorVersion
public int getMajorVersion()
- Specified by:
getMajorVersionin interfacejava.sql.Driver
-
getMinorVersion
public int getMinorVersion()
- Specified by:
getMinorVersionin interfacejava.sql.Driver
-
jdbcCompliant
public boolean jdbcCompliant()
- Specified by:
jdbcCompliantin interfacejava.sql.Driver
-
getParentLogger
public java.util.logging.Logger getParentLogger() throws java.sql.SQLFeatureNotSupportedException- Specified by:
getParentLoggerin interfacejava.sql.Driver- Throws:
java.sql.SQLFeatureNotSupportedException
-
tokenizeProtocol
private static int tokenizeProtocol(java.lang.String url, java.util.StringTokenizer urlTokenizer) throws SqlException- Throws:
SqlException
-
tokenizeServerName
private static java.lang.String tokenizeServerName(java.util.StringTokenizer urlTokenizer, java.lang.String url) throws SqlException- Throws:
SqlException
-
tokenizeOptionalPortNumber
private static int tokenizeOptionalPortNumber(java.util.StringTokenizer urlTokenizer, java.lang.String url) throws SqlException- Throws:
SqlException
-
tokenizeDatabase
private static java.lang.String tokenizeDatabase(java.util.StringTokenizer urlTokenizer, java.lang.String url) throws SqlException- Throws:
SqlException
-
tokenizeURLProperties
private static java.util.Properties tokenizeURLProperties(java.lang.String url, java.util.Properties properties) throws SqlException- Throws:
SqlException
-
getFactory
public static ClientJDBCObjectFactory getFactory()
This method returns an Implementation of ClientJDBCObjectFactory depending on VM under use Currently it returns either ClientJDBCObjectFactoryImpl (or) ClientJDBCObjectFactoryImpl42
-
createDefaultFactoryImpl
private static ClientJDBCObjectFactory createDefaultFactoryImpl()
Returns an instance of the ClientJDBCObjectFactoryImpl class
-
createJDBC40FactoryImpl
private static ClientJDBCObjectFactory createJDBC40FactoryImpl()
Returns an instance of the ClientJDBCObjectFactoryImpl40 class If a ClassNotFoundException occurs then it returns an instance of ClientJDBCObjectFactoryImpl If a future version of JDBC comes then a similar method would be added say createJDBCXXFactoryImpl in which if the class is not found then it would return the lower version thus having a sort of cascading effect until it gets a valid instance
-
createJDBC42FactoryImpl
private static ClientJDBCObjectFactory createJDBC42FactoryImpl()
Returns an instance of the ClientJDBCObjectFactoryImpl42 class If a ClassNotFoundException occurs then it returns an instance of the most refined ClientJDBCObjectFactoryImpl possible If a future version of JDBC comes then a similar method would be added say createJDBCXXFactoryImpl in which if the class is not found then it would return the lower version thus having a sort of cascading effect until it gets a valid instance
-
-