Package dev.frostlake.jdbc
Class DatabaseDriver
java.lang.Object
dev.frostlake.jdbc.DatabaseDriver
- All Implemented Interfaces:
Driver
JDBC Driver for Frostlake SQL Engine
Usage:
Class.forName("dev.frostlake.jdbc.DatabaseDriver");
Connection conn = DriverManager.getConnection("jdbc:frostlake://localhost:8080", props);
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptsURL(String url) static DatabaseEnginecloseFileEngine(String dataDir) Close the shared engine behind ajdbc: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.connect(String url, Properties info) intintgetPropertyInfo(String url, Properties info) booleanstatic voidregisterDirectEngine(String name, DatabaseEngine engine) Register a pre-built engine under a direct-URL name, sojdbc:frostlake:direct:<name>connections reach it instead of lazily creating a fresh empty engine.static DatabaseEngineunregisterDirectEngine(String name) Remove a registered direct engine; returns it (for shutdown) or null if the name is unknown.
-
Constructor Details
-
DatabaseDriver
public DatabaseDriver()
-
-
Method Details
-
connect
- Specified by:
connectin interfaceDriver- Throws:
SQLException
-
acceptsURL
- Specified by:
acceptsURLin interfaceDriver
-
registerDirectEngine
Register a pre-built engine under a direct-URL name, sojdbc: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
Remove a registered direct engine; returns it (for shutdown) or null if the name is unknown. -
closeFileEngine
Close the shared engine behind ajdbc: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
- Specified by:
getPropertyInfoin interfaceDriver
-
getMajorVersion
public int getMajorVersion()- Specified by:
getMajorVersionin interfaceDriver
-
getMinorVersion
public int getMinorVersion()- Specified by:
getMinorVersionin interfaceDriver
-
jdbcCompliant
public boolean jdbcCompliant()- Specified by:
jdbcCompliantin interfaceDriver
-
getParentLogger
- Specified by:
getParentLoggerin interfaceDriver- Throws:
SQLFeatureNotSupportedException
-