net.spy.db
Class JDBCConnectionSource

java.lang.Object
  extended by net.spy.SpyObject
      extended by net.spy.db.JDBCConnectionSource
All Implemented Interfaces:
ConnectionSource

public class JDBCConnectionSource
extends SpyObject
implements ConnectionSource

Implementation of ConnectionSource that gets connections directly from JDBC.


Constructor Summary
JDBCConnectionSource()
           
 
Method Summary
 java.sql.Connection getConnection(SpyConfig conf)
          Get a new connection from JDBC.
 void returnConnection(java.sql.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

JDBCConnectionSource

public JDBCConnectionSource()
Method Detail

getConnection

public java.sql.Connection getConnection(SpyConfig conf)
                                  throws java.sql.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:
java.sql.SQLException - if a connection could not be obtained

returnConnection

public void returnConnection(java.sql.Connection conn)
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
See Also:
ConnectionSource


Copyright © 1995-2005 SPY Internetworking. All Rights Reserved.