org.springframework.jdbc.datasource.embedded
Class DerbyEmbeddedDatabaseConfigurer

java.lang.Object
  extended by org.springframework.jdbc.datasource.embedded.DerbyEmbeddedDatabaseConfigurer
All Implemented Interfaces:
EmbeddedDatabaseConfigurer

final class DerbyEmbeddedDatabaseConfigurer
extends java.lang.Object
implements EmbeddedDatabaseConfigurer

EmbeddedDatabaseConfigurer for the Apache Derby database.

Since:
3.0
Author:
Oliver Gierke, Juergen Hoeller

Field Summary
private static DerbyEmbeddedDatabaseConfigurer INSTANCE
           
private static boolean IS_AT_LEAST_DOT_SIX
           
private static Log logger
           
private static java.lang.String SHUTDOWN_CODE
           
private static java.lang.String SHUTDOWN_COMMAND
           
private static java.lang.String URL_TEMPLATE
           
 
Constructor Summary
private DerbyEmbeddedDatabaseConfigurer()
           
 
Method Summary
 void configureConnectionProperties(ConnectionProperties properties, java.lang.String databaseName)
          Configure the properties required to create and connect to the embedded database instance.
static DerbyEmbeddedDatabaseConfigurer getInstance()
          Get the singleton DerbyEmbeddedDatabaseConfigurer instance.
 void shutdown(javax.sql.DataSource dataSource, java.lang.String databaseName)
          Shutdown the embedded database instance that backs dataSource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final Log logger

URL_TEMPLATE

private static final java.lang.String URL_TEMPLATE
See Also:
Constant Field Values

SHUTDOWN_CODE

private static final java.lang.String SHUTDOWN_CODE
See Also:
Constant Field Values

IS_AT_LEAST_DOT_SIX

private static final boolean IS_AT_LEAST_DOT_SIX

SHUTDOWN_COMMAND

private static final java.lang.String SHUTDOWN_COMMAND

INSTANCE

private static DerbyEmbeddedDatabaseConfigurer INSTANCE
Constructor Detail

DerbyEmbeddedDatabaseConfigurer

private DerbyEmbeddedDatabaseConfigurer()
Method Detail

getInstance

public static DerbyEmbeddedDatabaseConfigurer getInstance()
                                                   throws java.lang.ClassNotFoundException
Get the singleton DerbyEmbeddedDatabaseConfigurer instance.

Returns:
the configurer
Throws:
java.lang.ClassNotFoundException - if Derby is not on the classpath

configureConnectionProperties

public void configureConnectionProperties(ConnectionProperties properties,
                                          java.lang.String databaseName)
Description copied from interface: EmbeddedDatabaseConfigurer
Configure the properties required to create and connect to the embedded database instance.

Specified by:
configureConnectionProperties in interface EmbeddedDatabaseConfigurer
databaseName - the name of the test database

shutdown

public void shutdown(javax.sql.DataSource dataSource,
                     java.lang.String databaseName)
Description copied from interface: EmbeddedDatabaseConfigurer
Shutdown the embedded database instance that backs dataSource.

Specified by:
shutdown in interface EmbeddedDatabaseConfigurer
Parameters:
dataSource - the data source
databaseName - the name of the database being shutdown