public final class H2ConnectionFactory extends Object implements ConnectionFactory
ConnectionFactory for creating connections to an H2 database.| Constructor and Description |
|---|
H2ConnectionFactory(H2ConnectionConfiguration configuration)
Creates a new connection factory.
|
| Modifier and Type | Method and Description |
|---|---|
Mono<H2Connection> |
create() |
H2ConnectionFactoryMetadata |
getMetadata() |
static CloseableConnectionFactory |
inMemory(String name)
Create a new
In-Memory database connection factory for database at name. |
static CloseableConnectionFactory |
inMemory(String name,
String username,
CharSequence password)
Create a new
In-Memory database connection factory for database at name given username and password. |
static CloseableConnectionFactory |
inMemory(String name,
String username,
CharSequence password,
Map<H2ConnectionOption,String> properties)
Create a new
In-Memory database connection factory for database at name given username and password. |
String |
toString() |
public H2ConnectionFactory(H2ConnectionConfiguration configuration)
configuration - the configuration to use to create connectionsNullPointerException - if configuration is nullpublic static CloseableConnectionFactory inMemory(String name)
In-Memory database connection factory for database at name.
The closeable ConnectionFactory keeps the database open unless the connection factory is closed.
The database gets created if it does not exist yet.
Connecting to an existing database closes the database for all participating components if the resulting ConnectionFactory is closed.
name - database namenamepublic static CloseableConnectionFactory inMemory(String name, String username, CharSequence password)
In-Memory database connection factory for database at name given username and password.
The closeable ConnectionFactory keeps the database open unless the connection factory is closed.
The database gets created if it does not exist yet.
Connecting to an existing database closes the database for all participating components if the resulting ConnectionFactory is closed.
name - database nameusername - the usernamepassword - the password to usename.public static CloseableConnectionFactory inMemory(String name, String username, CharSequence password, Map<H2ConnectionOption,String> properties)
In-Memory database connection factory for database at name given username and password.
The closeable ConnectionFactory keeps the database open unless the connection factory is closed.
Connecting to an existing database closes the database for all participating components if the resulting ConnectionFactory is closed.
name - database nameusername - the usernamepassword - the password to useproperties - properties to setname.H2ConnectionOptionpublic Mono<H2Connection> create()
create in interface ConnectionFactorypublic H2ConnectionFactoryMetadata getMetadata()
getMetadata in interface ConnectionFactoryCopyright © 2022. All rights reserved.