Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mentawai.db
Interface ConnectionHandler  view ConnectionHandler download ConnectionHandler.java

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.


Method Summary
 java.sql.Connection getConnection()
          Returns a Connection to the database.
 void release(java.sql.Connection conn)
          Release this connection.
 

Method Detail

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.