net.spy.db
Class JNDIConnectionSource
java.lang.Object
net.spy.SpyObject
net.spy.db.JNDIConnectionSource
- All Implemented Interfaces:
- ConnectionSource
public class JNDIConnectionSource
- extends SpyObject
- implements ConnectionSource
Connection source for getting DB connections from JNDI sources.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JNDIConnectionSource
public JNDIConnectionSource()
- Get an instance of JNDIConnectionSource.
getConnection
public Connection getConnection(SpyConfig conf)
throws SQLException
- This will get a connection to the JNDI resource.
The following parameters are required:
-
dbSource - the JNDI resource containing the connection
Additional parameters will be passed to InitialContext after
being converted to a Hashtable object. Note: It will not
be cast to Hashtable, but instead a new Hashtable instance will be
created with those parameters. This allows you to get connections
from a JNDI context that doesn't know about SpyConfig.
- Specified by:
getConnection in interface ConnectionSource
- Parameters:
conf - The configuration to use for getting the database
source
- Returns:
- A connection to the JNDI datasource
- Throws:
SQLException- See Also:
ConnectionSource
returnConnection
public void returnConnection(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-2007 SPY Internetworking. All Rights Reserved.