Top Description Fields Constructors Methods
org.springframework.jdbc.datasource.embedded

pack-priv final Class H2EmbeddedDatabaseConfigurer

extends AbstractEmbeddedDatabaseConfigurer
Class Inheritance
Imports
java.sql.Driver, org.springframework.lang.Nullable, org.springframework.util.ClassUtils

EmbeddedDatabaseConfigurer for an H2 embedded database instance.

Call getInstance() to get the singleton instance of this class.

Authors
Oliver Gierke, Juergen Hoeller, Sam Brannen
Since
3.0

Field Summary

Modifier and TypeField and Description
private final Class<? extends Driver>
private static H2EmbeddedDatabaseConfigurer
Inherited from org.springframework.jdbc.datasource.embedded.AbstractEmbeddedDatabaseConfigurer:
logger

Constructor Summary

AccessConstructor and Description
private
H2EmbeddedDatabaseConfigurer(Class<? extends Driver> driverClass)

Method Summary

Modifier and TypeMethod and Description
public void
configureConnectionProperties(ConnectionProperties
connection properties to configure
properties
,
String
the name of the embedded database
databaseName
)

Implements org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseConfigurer.configureConnectionProperties.

Configure the properties required to create and connect to the embedded database.
public static synchronized H2EmbeddedDatabaseConfigurer

Returns:

the configurer instance
getInstance
()

Get the singleton H2EmbeddedDatabaseConfigurer instance.

Inherited from org.springframework.jdbc.datasource.embedded.AbstractEmbeddedDatabaseConfigurer:
shutdown

Field Detail

driverClassback to summary
private final Class<? extends Driver> driverClass
instanceback to summary
private static H2EmbeddedDatabaseConfigurer instance
Annotations
@Nullable

Constructor Detail

H2EmbeddedDatabaseConfigurerback to summary
private H2EmbeddedDatabaseConfigurer(Class<? extends Driver> driverClass)

Method Detail

configureConnectionPropertiesback to summary
public void configureConnectionProperties(ConnectionProperties properties, String databaseName)

Implements org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseConfigurer.configureConnectionProperties.

Doc from org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseConfigurer.configureConnectionProperties.

Configure the properties required to create and connect to the embedded database.

Parameters
properties:ConnectionProperties

connection properties to configure

databaseName:String

the name of the embedded database

Annotations
@Override
getInstanceback to summary
public static synchronized H2EmbeddedDatabaseConfigurer getInstance() throws ClassNotFoundException

Get the singleton H2EmbeddedDatabaseConfigurer instance.

Returns:H2EmbeddedDatabaseConfigurer

the configurer instance

Annotations
@SuppressWarnings:unchecked
Exceptions
ClassNotFoundException:
if H2 is not on the classpath