java.lang.Object
is.codion.dbms.h2.H2DatabaseFactory
- All Implemented Interfaces:
DatabaseFactory
Provides h2 database implementations
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Runs scripts using the H2 RunScript tool. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Database
createDatabase
(String url, String... initScripts) Creates a H2 Database instanceboolean
driverCompatible
(String driverClassName) scriptRunner
(String jdbcUrl) Creates a new ScriptRunner instance, using by default the sysadmin username (sa) and the default system charset.
-
Constructor Details
-
H2DatabaseFactory
public H2DatabaseFactory()
-
-
Method Details
-
driverCompatible
- Specified by:
driverCompatible
in interfaceDatabaseFactory
- Parameters:
driverClassName
- the driver class name- Returns:
- true if this database factory is compatible with the given driver
-
create
- Specified by:
create
in interfaceDatabaseFactory
- Parameters:
url
- the jdbc url- Returns:
- a new
Database
implementation based on the given jdbc url.
-
createDatabase
Creates a H2 Database instance- Parameters:
url
- the jdbc urlinitScripts
- initialization scripts to run on database creation- Returns:
- a H2 Database instance
-
scriptRunner
Creates a new ScriptRunner instance, using by default the sysadmin username (sa) and the default system charset.- Parameters:
jdbcUrl
- the jdbc URL- Returns:
- a new
H2DatabaseFactory.ScriptRunner
instance
-