net.toften.jlips.persist.db
Interface DBConnectionHandler

All Superinterfaces:
DataSource
All Known Implementing Classes:
DBJNDIConnection, DBPooledConnection, DBSimpleConnection

public interface DBConnectionHandler
extends DataSource

This interface must be implemented by the class handling the connection to the database. The responsibility of the connction handler is to create and release connections to the database. The interface extends the DataSource interface and must thus implement it's methods aswell. jLips provides a number of connection handlers aswell as an abstract connection handler and a DataSource wrapper connection handler for the use of the application. Normally the application would use the DBSimpleConnection connection handler.

Version:
$Revision: 1.4 $
Author:
thomas
See Also:
DataSource

Method Summary
 DBProperties getConnectionProperties()
          This method must return a reference to the properties passed in by the application.
 void releaseConnection(Connection theConnection)
          When jLips is done with a connection it will call this method to allow the connection handler to properly dispose of the connection
 void setConnectionProperties(DBProperties connectionProperties)
          Method used to pass in the database connection properties provided by the application The connection handler will need these properties to connect to the database
 
Methods inherited from interface javax.sql.DataSource
getConnection, getConnection, getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
 

Method Detail

setConnectionProperties

void setConnectionProperties(DBProperties connectionProperties)
                             throws DBBadPropertiesException
Method used to pass in the database connection properties provided by the application The connection handler will need these properties to connect to the database

Parameters:
connectionProperties - The database connection properties passed in bu the application
Throws:
DBBadPropertiesException - Should be thrown if the passed in properties are not valid or does not contain all the necessary information

releaseConnection

void releaseConnection(Connection theConnection)
When jLips is done with a connection it will call this method to allow the connection handler to properly dispose of the connection

Parameters:
theConnection - The connection to be disposed

getConnectionProperties

DBProperties getConnectionProperties()
This method must return a reference to the properties passed in by the application. Because the properties might be changed by the connection handler, the Factory does not hold a copy of these properties. Whenever the Factory needs to access the properties it will use this method.

Returns:
The current DBProperties object