- All Known Implementing Classes:
- C3P0ConnectionHandler, DataSourceConnectionHandler, DBCPConnectionHandler, JNDIConnectionHandler
- public interface ConnectionHandler
This interface describes the behaviour of a Mentawai database connection provider.
Classes implementing this interface may or may not use an underlying connection pool.
This is a transparent way to get a connection to a database with Mentawai.
getConnection
public java.sql.Connection getConnection()
throws java.sql.SQLException
- Returns a Connection to the database.
Notice that it can never return null. If no connection can be acquired, then a SQLException is thrown.
release
public void release(java.sql.Connection conn)
- Release this connection.
If this connection handler is using a database pool, the connection is returned to the pool.
If this connection handler is not using a database pool, the connection is closed.
If the connection passed as an argument is null, nothing is done.