Interface PooledConnection

public interface PooledConnection

A PooledConnection object is a database connection managed by a connection pool. It can be retrieved, used for querying the database, and returned to the pool afterward. Using pooled connections makes sense in multiuser and multithreaded environments, such as application servers.

Methods

addConnectionEventListener

public void addConnectionEventListener(ConnectionEventListener listener)

You can use this to add an event listener to the pooled connection when you want to be notified of connection events such as a close or errors.

Parameters:

listener:

The listener object that needs to be notified of events occurring for the connection

close

public void close() throws java.sql.SQLException

This closes the physical connection. A SQLException is thrown if a database access error occurs.

getConnection

public java.sql.Connection getConnection() throws java.sql.SQLException 

This obtains the Connection object associated to the pooled connection. A SQLException is thrown if a database access error occurs.

Returns: A Connection object

removeConnectionEventListener

public void removeConnectionEventListener(ConnectionEventListener listener)

This removes an event listener from the pooled connection.

Parameters:

listener:

The listener object that no longer needs to be notified



JDBC 3. 0. JAVA Database Connectivity
JDBC 3: Java Database Connectivity
ISBN: 0764548751
EAN: 2147483647
Year: 2002
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net