Package net.sourceforge.jtds.jdbcx
Class PooledConnection
- java.lang.Object
-
- net.sourceforge.jtds.jdbcx.PooledConnection
-
- All Implemented Interfaces:
javax.sql.PooledConnection
- Direct Known Subclasses:
JtdsXAConnection
public class PooledConnection extends java.lang.Object implements javax.sql.PooledConnectionjTDS implementation of thePooledConnectioninterface.- Version:
- $Id: PooledConnection.java,v 1.11.6.3 2009-12-30 08:45:34 ickzon Exp $
-
-
Field Summary
Fields Modifier and Type Field Description protected java.sql.Connectionconnectionprivate java.util.ArrayListlisteners
-
Constructor Summary
Constructors Constructor Description PooledConnection(java.sql.Connection connection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConnectionEventListener(javax.sql.ConnectionEventListener listener)Adds the specified listener to the list.voidaddStatementEventListener(javax.sql.StatementEventListener listener)voidclose()Closes the database connection.voidfireConnectionEvent(boolean closed, java.sql.SQLException sqlException)Fires a new connection event on all listeners.java.sql.ConnectiongetConnection()Returns a ConnectionProxy.voidremoveConnectionEventListener(javax.sql.ConnectionEventListener listener)Removes the specified listener from the list.voidremoveStatementEventListener(javax.sql.StatementEventListener listener)
-
-
-
Method Detail
-
addConnectionEventListener
public void addConnectionEventListener(javax.sql.ConnectionEventListener listener)
Adds the specified listener to the list.- Specified by:
addConnectionEventListenerin interfacejavax.sql.PooledConnection- See Also:
fireConnectionEvent(boolean, java.sql.SQLException),removeConnectionEventListener(javax.sql.ConnectionEventListener)
-
close
public void close() throws java.sql.SQLExceptionCloses the database connection.- Specified by:
closein interfacejavax.sql.PooledConnection- Throws:
java.sql.SQLException- if an error occurs
-
fireConnectionEvent
public void fireConnectionEvent(boolean closed, java.sql.SQLException sqlException)Fires a new connection event on all listeners.- Parameters:
closed-trueifclosehas been called on the connection;falseif thesqlExceptionrepresents an error where the connection may not longer be used.sqlException- the SQLException to pass to the listeners
-
getConnection
public java.sql.Connection getConnection() throws java.sql.SQLExceptionReturns a ConnectionProxy.- Specified by:
getConnectionin interfacejavax.sql.PooledConnection- Throws:
java.sql.SQLException- if an error occurs
-
removeConnectionEventListener
public void removeConnectionEventListener(javax.sql.ConnectionEventListener listener)
Removes the specified listener from the list.- Specified by:
removeConnectionEventListenerin interfacejavax.sql.PooledConnection- See Also:
addConnectionEventListener(javax.sql.ConnectionEventListener),fireConnectionEvent(boolean, java.sql.SQLException)
-
addStatementEventListener
public void addStatementEventListener(javax.sql.StatementEventListener listener)
- Specified by:
addStatementEventListenerin interfacejavax.sql.PooledConnection
-
removeStatementEventListener
public void removeStatementEventListener(javax.sql.StatementEventListener listener)
- Specified by:
removeStatementEventListenerin interfacejavax.sql.PooledConnection
-
-