net.spy.db
Interface ConnectionSource

All Known Implementing Classes:
JDBCConnectionSource, JNDIConnectionSource, ObjectPoolConnectionSource

public interface ConnectionSource

Interface for classes that will create database connections.


Method Summary
 Connection getConnection(SpyConfig conf)
          Get a new connection.
 void returnConnection(Connection conn)
          Return a connection.
 

Method Detail

getConnection

public Connection getConnection(SpyConfig conf)
                         throws SQLException
Get a new connection.

Parameters:
conf - a SpyConfig describing the connection that needs to be fetched.
Throws:
SQLException - if a connection could not be obtained

returnConnection

public void returnConnection(Connection conn)
                      throws SQLException
Return a connection. This method is used to inform whatever pooling mechanism is in use that the connection is no longer wanted, or needed, or even cared about here.

Throws:
SQLException