Class DatabaseDriver

java.lang.Object
dev.frostlake.jdbc.DatabaseDriver
All Implemented Interfaces:
Driver

public class DatabaseDriver extends Object implements Driver
JDBC Driver for Frostlake SQL Engine Usage: Class.forName("dev.frostlake.jdbc.DatabaseDriver"); Connection conn = DriverManager.getConnection("jdbc:frostlake://localhost:8080", props);
  • Constructor Details

    • DatabaseDriver

      public DatabaseDriver()
  • Method Details

    • connect

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

      public boolean acceptsURL(String url)
      Specified by:
      acceptsURL in interface Driver
    • registerDirectEngine

      public static void registerDirectEngine(String name, DatabaseEngine engine)
      Register a pre-built engine under a direct-URL name, so jdbc:frostlake:direct:<name> connections reach it instead of lazily creating a fresh empty engine. This is how a harness hands out engine-instance clones (DatabaseEngine.cloneInstance()): clone the migrated template, register the clone under a per-test-class name, and point that class's JDBC url at it — each class then runs on its own engine (and its own monitor, so classes execute SQL in parallel instead of serializing on one shared engine).
    • unregisterDirectEngine

      public static DatabaseEngine unregisterDirectEngine(String name)
      Remove a registered direct engine; returns it (for shutdown) or null if the name is unknown.
    • closeFileEngine

      public static DatabaseEngine closeFileEngine(String dataDir) throws IOException
      Close the shared engine behind a jdbc:frostlake:file:<dir> URL: persist its final state, release the directory lock and forget the engine, so a later connection re-opens the directory (restoring the state) fresh. Returns the closed engine, or null if the directory has no open engine. This is the in-JVM equivalent of the exit-time shutdown hook, for embedders that want to release a data directory without exiting.
      Throws:
      IOException
    • getPropertyInfo

      public DriverPropertyInfo[] getPropertyInfo(String url, Properties info)
      Specified by:
      getPropertyInfo in interface Driver
    • 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