net.spy.db
Class ObjectPoolConnectionSource

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

public class ObjectPoolConnectionSource
extends SpyObject
implements ConnectionSource

Connection source to retrieve connections from an ObjectPool. The configuration passed into getConnection() requires the following parameters:

The following parameters are optional:


Constructor Summary
ObjectPoolConnectionSource()
          Get an instance of SpyPoolConnectionSource.
 
Method Summary
 Connection getConnection(SpyConfig conf)
          Get a new connection.
 void returnConnection(Connection conn)
          Return a connection.
 
Methods inherited from class net.spy.SpyObject
getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectPoolConnectionSource

public ObjectPoolConnectionSource()
Get an instance of SpyPoolConnectionSource.

Method Detail

getConnection

public Connection getConnection(SpyConfig conf)
                         throws SQLException
Description copied from interface: ConnectionSource
Get a new connection.

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
See Also:
ConnectionSource

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