net.spy.db
Class JDBCConnectionSource

java.lang.Object
  extended bynet.spy.db.JDBCConnectionSource
All Implemented Interfaces:
ConnectionSource

public class JDBCConnectionSource
extends Object
implements ConnectionSource

Implementation of ConnectionSource that gets connections directly from JDBC.


Constructor Summary
JDBCConnectionSource()
           
 
Method Summary
 Connection getConnection(SpyConfig conf)
          Get a new connection from JDBC.
 void returnConnection(Connection conn)
          Return a connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCConnectionSource

public JDBCConnectionSource()
Method Detail

getConnection

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

The configuration is expected to have the following values:

Specified by:
getConnection in interface ConnectionSource
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
Description copied from interface: ConnectionSource
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.

Specified by:
returnConnection in interface ConnectionSource
Throws:
SQLException
See Also:
ConnectionSource