Class AutoloadedDriver

java.lang.Object
org.apache.derby.jdbc.AutoloadedDriver
All Implemented Interfaces:
Driver

public class AutoloadedDriver extends Object implements Driver
This is the dummy driver which is registered with the DriverManager and which is autoloaded by JDBC4. Loading this class will NOT automatically boot the Derby engine, but it will register this class as a valid Driver with the DriverManager. Instead, the engine boots lazily when you ask for a Connection. Alternatively, you can force the engine to boot as follows:
 Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();

 // or

    new org.apache.derby.jdbc.EmbeddedDriver();


  • Field Details

    • _engineForcedDown

      private static boolean _engineForcedDown
    • _autoloadedDriver

      private static AutoloadedDriver _autoloadedDriver
    • _driverModule

      private static Driver _driverModule
  • Constructor Details

    • AutoloadedDriver

      public AutoloadedDriver()
  • Method Details

    • registerMe

      protected static void registerMe(AutoloadedDriver me)
    • acceptsURL

      public boolean acceptsURL(String url) throws SQLException
      Accept anything that starts with jdbc:derby:.
      Specified by:
      acceptsURL in interface Driver
      Throws:
      SQLException - if a database-access error occurs.
      See Also:
    • connect

      public Connection connect(String url, Properties info) throws SQLException
      Connect to the URL if possible
      Specified by:
      connect in interface Driver
      Throws:
      SQLException - illegal url or problem with connectiong
      See Also:
    • getPropertyInfo

      public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException
      Returns an array of DriverPropertyInfo objects describing possible properties.
      Specified by:
      getPropertyInfo in interface Driver
      Throws:
      SQLException - if a database-access error occurs.
      See Also:
    • getMajorVersion

      public int getMajorVersion()
      Returns the driver's major version number.
      Specified by:
      getMajorVersion in interface Driver
      See Also:
    • getMinorVersion

      public int getMinorVersion()
      Returns the driver's minor version number.
      Specified by:
      getMinorVersion in interface Driver
      See Also:
    • jdbcCompliant

      public boolean jdbcCompliant()
      Report whether the Driver is a genuine JDBC COMPLIANT (tm) driver.
      Specified by:
      jdbcCompliant in interface Driver
      See Also:
    • getParentLogger

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

      static Driver getDriverModule() throws SQLException
      ////////////////////////////////////////////////////////////////////
      Throws:
      SQLException
    • registerDriverModule

      static void registerDriverModule(Driver driver)
      Record which driver module actually booted.
      Parameters:
      driver - the driver register to DriverManager is not AutoloadedDriver
    • unregisterDriverModule

      static void unregisterDriverModule()
      Unregister the driver and the AutoloadedDriver if exists. This happens when the engine is forcibly shut down.
    • deregisterDriver

      private static void deregisterDriver(AutoloadedDriver driver) throws SQLException
      Throws:
      SQLException
    • isBooted

      private static boolean isBooted()
    • makeAutoloadedDriver

      private static AutoloadedDriver makeAutoloadedDriver()
      Load the most capable driver available. But if the vm level doesn't support it, then we fall back on a lower-level driver.
      Returns:
      AutoloadedDriver