public final class Databases extends Object
Modifier and Type | Method and Description |
---|---|
static Database |
createFrom(String driver,
String url)
Create a pooled database named "default" with the given driver and url.
|
static Database |
createFrom(String driver,
String url,
Map<String,? extends Object> config)
Create a pooled database named "default" with the given configuration.
|
static Database |
createFrom(String name,
String driver,
String url)
Create a pooled database with the given configuration.
|
static Database |
createFrom(String name,
String driver,
String url,
Map<String,? extends Object> config)
Create a pooled database with the given configuration.
|
static Database |
inMemory()
Create an in-memory H2 database with name "default".
|
static Database |
inMemory(Map<String,? extends Object> config)
Create an in-memory H2 database with name "default".
|
static Database |
inMemory(String name)
Create an in-memory H2 database.
|
static Database |
inMemory(String name,
Map<String,? extends Object> config)
Create an in-memory H2 database.
|
static Database |
inMemory(String name,
Map<String,String> urlOptions,
Map<String,? extends Object> config)
Create an in-memory H2 database.
|
static Database |
inMemory(String name,
String url,
Map<String,? extends Object> config)
Create an in-memory H2 database.
|
static Database |
inMemoryWith(String k1,
Object v1)
Create an in-memory H2 database with name "default" and with extra configuration provided by
the given entries.
|
static Database |
inMemoryWith(String k1,
Object v1,
String k2,
Object v2)
Create an in-memory H2 database with name "default" and with extra configuration provided by
the given entries.
|
static Database |
inMemoryWith(String k1,
Object v1,
String k2,
Object v2,
String k3,
Object v3)
Create an in-memory H2 database with name "default" and with extra configuration provided by
the given entries.
|
public static Database createFrom(String name, String driver, String url, Map<String,? extends Object> config)
name
- the database namedriver
- the database driver classurl
- the database urlconfig
- a map of extra database configurationpublic static Database createFrom(String name, String driver, String url)
name
- the database namedriver
- the database driver classurl
- the database urlpublic static Database createFrom(String driver, String url, Map<String,? extends Object> config)
driver
- the database driver classurl
- the database urlconfig
- a map of extra database configurationpublic static Database createFrom(String driver, String url)
driver
- the database driver classurl
- the database urlpublic static Database inMemory(String name, String url, Map<String,? extends Object> config)
name
- the database nameurl
- the database urlconfig
- a map of extra database configurationpublic static Database inMemory(String name, Map<String,String> urlOptions, Map<String,? extends Object> config)
name
- the database nameurlOptions
- a map of extra url optionsconfig
- a map of extra database configurationpublic static Database inMemory(String name, Map<String,? extends Object> config)
name
- the database nameconfig
- a map of extra database configurationpublic static Database inMemory(String name)
name
- the database namepublic static Database inMemory(Map<String,? extends Object> config)
config
- a map of extra database configurationpublic static Database inMemory()
public static Database inMemoryWith(String k1, Object v1)
k1
- an H2 configuration key.v1
- configuration value corresponding to `k1`public static Database inMemoryWith(String k1, Object v1, String k2, Object v2)
k1
- an H2 configuration keyv1
- H2 configuration value corresponding to `k1`k2
- a second H2 configuration keyv2
- a configuration value corresponding to `k2`public static Database inMemoryWith(String k1, Object v1, String k2, Object v2, String k3, Object v3)
k1
- an H2 configuration keyv1
- H2 configuration value corresponding to `k1`k2
- a second H2 configuration keyv2
- a configuration value corresponding to `k2`k3
- a third H2 configuration keyv3
- a configuration value corresponding to `k3`