net.sourceforge.jtds.jdbcx

Class PooledConnection

Implemented Interfaces:
javax.sql.PooledConnection
Known Direct Subclasses:
JtdsXAConnection

public class PooledConnection
extends java.lang.Object
implements javax.sql.PooledConnection

jTDS implementation of the PooledConnection interface.
Version:
$Id: PooledConnection.java,v 1.11 2005/02/01 23:52:50 alin_sinpalean Exp $

Field Summary

protected Connection
connection
private ArrayList
listeners

Constructor Summary

PooledConnection(Connection connection)

Method Summary

void
addConnectionEventListener(ConnectionEventListener listener)
Adds the specified listener to the list.
void
close()
Closes the database connection.
void
fireConnectionEvent(boolean closed, SQLException sqlException)
Fires a new connection event on all listeners.
Connection
getConnection()
Returns a ConnectionProxy.
void
removeConnectionEventListener(ConnectionEventListener listener)
Removes the specified listener from the list.

Field Details

connection

protected Connection connection

listeners

private ArrayList listeners

Constructor Details

PooledConnection

public PooledConnection(Connection connection)

Method Details

addConnectionEventListener

public void addConnectionEventListener(ConnectionEventListener listener)
Adds the specified listener to the list.

close

public void close()
            throws SQLException
Closes the database connection.

fireConnectionEvent

public void fireConnectionEvent(boolean closed,
                                SQLException sqlException)
Fires a new connection event on all listeners.
Parameters:
closed - true if close has been called on the connection; false if the sqlException represents an error where the connection may not longer be used.
sqlException - the SQLException to pass to the listeners

getConnection

public Connection getConnection()
            throws SQLException
Returns a ConnectionProxy.

removeConnectionEventListener

public void removeConnectionEventListener(ConnectionEventListener listener)
Removes the specified listener from the list.

Generated on September 18 2009