Class ClientDriver

java.lang.Object
org.apache.derby.jdbc.ClientDriver
All Implemented Interfaces:
Driver
Direct Known Subclasses:
ClientDriver40

public class ClientDriver extends Object implements Driver
The client JDBC driver (type 4) for Derby.
  • Field Details

    • traceFileSuffixIndex_

      private transient int traceFileSuffixIndex_
    • DERBY_REMOTE_PROTOCOL

      private static final int DERBY_REMOTE_PROTOCOL
      See Also:
    • factoryObject

      private static ClientJDBCObjectFactory factoryObject
    • exceptionsOnLoadDriver__

      private static SQLException exceptionsOnLoadDriver__
    • registeredDriver__

      private static ClientDriver registeredDriver__
  • Constructor Details

    • ClientDriver

      public ClientDriver()
  • Method Details

    • registerMe

      protected static void registerMe(ClientDriver me)
    • connect

      public Connection connect(String url, Properties properties) throws SQLException
      Specified by:
      connect in interface Driver
      Throws:
      SQLException
    • appendDatabaseAttributes

      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. Other attributes will be sent to the server with the database name Assumes augmentedProperties is not null
      Parameters:
      database - - Short database name
      augmentedProperties - - Set of properties to append as attributes
      Returns:
      databaseName + attributes (e.g. mydb;create=true)
    • acceptsURL

      public boolean acceptsURL(String url) throws SQLException
      Specified by:
      acceptsURL in interface Driver
      Throws:
      SQLException
    • checkURLNotNull

      private void checkURLNotNull(String url) throws SQLException
      Throws:
      SQLException
    • getPropertyInfo

      public DriverPropertyInfo[] getPropertyInfo(String url, Properties properties) throws SQLException
      Specified by:
      getPropertyInfo in interface Driver
      Throws:
      SQLException
    • getMajorVersion

      public int getMajorVersion()
      Specified by:
      getMajorVersion in interface Driver
    • getMinorVersion

      public int getMinorVersion()
      Specified by:
      getMinorVersion in interface Driver
    • jdbcCompliant

      public boolean jdbcCompliant()
      Specified by:
      jdbcCompliant in interface Driver
    • getParentLogger

      public Logger getParentLogger() throws SQLFeatureNotSupportedException
      Specified by:
      getParentLogger in interface Driver
      Throws:
      SQLFeatureNotSupportedException
    • tokenizeProtocol

      private static int tokenizeProtocol(String url, StringTokenizer urlTokenizer) throws SqlException
      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

      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