Package org.apache.derby.jdbc
Class ClientDriver
java.lang.Object
org.apache.derby.jdbc.ClientDriver
- All Implemented Interfaces:
Driver
- Direct Known Subclasses:
ClientDriver40
The client JDBC driver (type 4) for Derby.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static SQLException
private static ClientJDBCObjectFactory
private static ClientDriver
private int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
acceptsURL
(String url) private String
appendDatabaseAttributes
(String database, 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 void
checkURLNotNull
(String url) connect
(String url, Properties properties) private static ClientJDBCObjectFactory
Returns an instance of the ClientJDBCObjectFactoryImpl classprivate static ClientJDBCObjectFactory
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 ClientJDBCObjectFactory
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 ClientJDBCObjectFactory
This method returns an Implementation of ClientJDBCObjectFactory depending on VM under use Currently it returns either ClientJDBCObjectFactoryImpl (or) ClientJDBCObjectFactoryImpl42int
int
getPropertyInfo
(String url, Properties properties) boolean
protected static void
private static String
tokenizeDatabase
(StringTokenizer urlTokenizer, String url) private static int
tokenizeOptionalPortNumber
(StringTokenizer urlTokenizer, String url) private static int
tokenizeProtocol
(String url, StringTokenizer urlTokenizer) private static String
tokenizeServerName
(StringTokenizer urlTokenizer, String url) private static Properties
tokenizeURLProperties
(String url, Properties properties)
-
Field Details
-
traceFileSuffixIndex_
private transient int traceFileSuffixIndex_ -
DERBY_REMOTE_PROTOCOL
private static final int DERBY_REMOTE_PROTOCOL- See Also:
-
factoryObject
-
exceptionsOnLoadDriver__
-
registeredDriver__
-
-
Constructor Details
-
ClientDriver
public ClientDriver()
-
-
Method Details
-
registerMe
-
connect
- Specified by:
connect
in interfaceDriver
- Throws:
SQLException
-
appendDatabaseAttributes
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
- Specified by:
acceptsURL
in interfaceDriver
- Throws:
SQLException
-
checkURLNotNull
- Throws:
SQLException
-
getPropertyInfo
- Specified by:
getPropertyInfo
in interfaceDriver
- Throws:
SQLException
-
getMajorVersion
public int getMajorVersion()- Specified by:
getMajorVersion
in interfaceDriver
-
getMinorVersion
public int getMinorVersion()- Specified by:
getMinorVersion
in interfaceDriver
-
jdbcCompliant
public boolean jdbcCompliant()- Specified by:
jdbcCompliant
in interfaceDriver
-
getParentLogger
- Specified by:
getParentLogger
in interfaceDriver
- Throws:
SQLFeatureNotSupportedException
-
tokenizeProtocol
- Throws:
SqlException
-
tokenizeServerName
private static String tokenizeServerName(StringTokenizer urlTokenizer, String url) throws SqlException - Throws:
SqlException
-
tokenizeOptionalPortNumber
private static int tokenizeOptionalPortNumber(StringTokenizer urlTokenizer, String url) throws SqlException - Throws:
SqlException
-
tokenizeDatabase
private static String tokenizeDatabase(StringTokenizer urlTokenizer, String url) throws SqlException - Throws:
SqlException
-
tokenizeURLProperties
private static Properties tokenizeURLProperties(String url, Properties properties) throws SqlException - Throws:
SqlException
-
getFactory
This method returns an Implementation of ClientJDBCObjectFactory depending on VM under use Currently it returns either ClientJDBCObjectFactoryImpl (or) ClientJDBCObjectFactoryImpl42 -
createDefaultFactoryImpl
Returns an instance of the ClientJDBCObjectFactoryImpl class -
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
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
-