toolbox.dao
Interface ConnectionManager

Package class diagram package ConnectionManager
All Known Implementing Classes:
ConnectionManagerDataSourceImpl, ConnectionManagerDerbyImpl, ConnectionManagerPoolImpl

public interface ConnectionManager

Interface to abstract the underlying mechanism of obtaining managed connections.


Method Summary
 void destroy()
          Perform cleanup operations.
 java.sql.Connection getConnection()
          Returns a reference to a pooled connection.
 void init(XMLProperties xmlProps)
          Initialise the connection manager with the given XMLProperties.
 void releaseConnection(java.sql.Connection connection)
          Release a connection.
 

Method Detail

init

void init(XMLProperties xmlProps)
          throws DaoException
Initialise the connection manager with the given XMLProperties. Implementations will initialise the mechanism for managing database connections here.

Parameters:
xmlProps - XML configuration properties
Throws:
DaoException - if the manager cannot be initialised.

getConnection

java.sql.Connection getConnection()
                                  throws DaoException
Returns a reference to a pooled connection.

Returns:
A managed connection.
Throws:
DaoException - if a connection cannot be obtained.

releaseConnection

void releaseConnection(java.sql.Connection connection)
Release a connection.

Parameters:
connection - Connection to release

destroy

void destroy()
             throws DaoException
Perform cleanup operations.

Throws:
DaoException