toolbox.dao
Class ConnectionManagerDerbyImpl

Package class diagram package ConnectionManagerDerbyImpl
java.lang.Object
  extended by toolbox.dao.ConnectionManagerDerbyImpl
All Implemented Interfaces:
ConnectionManager

public class ConnectionManagerDerbyImpl
extends java.lang.Object
implements ConnectionManager

Specialised ConnectionManager implementation to facilitate the use of the Apache Derby embedded database environment.

This implementation requires a special instance of the DaoManager XML configuration document. The document must provide two instances of the JDBCConfig element. The first must be named derby-data and the second must be called derby-close. The derby-close instance must specify a valid Derby connection URL for shutting down the system or database.


Constructor Summary
ConnectionManagerDerbyImpl()
          Default constructor
 
Method Summary
 void destroy()
          Shuts down the embedded environment.
 java.sql.Connection getConnection()
          Returns a reference to the embedded database connection.
 void init(XMLProperties xmlProps)
          Initialise the connection manager with the given XMLProperties.
 void releaseConnection(java.sql.Connection connection)
          Empty implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionManagerDerbyImpl

public ConnectionManagerDerbyImpl()
Default constructor

Method Detail

init

public void init(XMLProperties xmlProps)
          throws DaoException
Initialise the connection manager with the given XMLProperties.

Specified by:
init in interface ConnectionManager
Parameters:
xmlProps - XML configuration properties
Throws:
DaoException - if the manager cannot be initialised.

getConnection

public java.sql.Connection getConnection()
                                  throws DaoException
Returns a reference to the embedded database connection.

Specified by:
getConnection in interface ConnectionManager
Returns:
Embedded database connection.
Throws:
DaoException - if a the connection cannot be obtained.

releaseConnection

public void releaseConnection(java.sql.Connection connection)
Empty implementation.

Specified by:
releaseConnection in interface ConnectionManager
Parameters:
connection - The embedded database connection.

destroy

public void destroy()
             throws DaoException
Shuts down the embedded environment.

Specified by:
destroy in interface ConnectionManager
Throws:
DaoException - if the manager cannot be destroyed.