public class PooledConnection
extends java.lang.Object
implements javax.sql.PooledConnection
PooledConnection
interface.Modifier and Type | Field and Description |
---|---|
protected java.sql.Connection |
connection |
private java.util.ArrayList |
listeners |
Constructor and Description |
---|
PooledConnection(java.sql.Connection connection) |
Modifier and Type | Method and Description |
---|---|
void |
addConnectionEventListener(javax.sql.ConnectionEventListener listener)
Adds the specified listener to the list.
|
void |
addStatementEventListener(javax.sql.StatementEventListener listener) |
void |
close()
Closes the database connection.
|
void |
fireConnectionEvent(boolean closed,
java.sql.SQLException sqlException)
Fires a new connection event on all listeners.
|
java.sql.Connection |
getConnection()
Returns a ConnectionProxy.
|
void |
removeConnectionEventListener(javax.sql.ConnectionEventListener listener)
Removes the specified listener from the list.
|
void |
removeStatementEventListener(javax.sql.StatementEventListener listener) |
private java.util.ArrayList listeners
protected java.sql.Connection connection
public void addConnectionEventListener(javax.sql.ConnectionEventListener listener)
addConnectionEventListener
in interface javax.sql.PooledConnection
fireConnectionEvent(boolean, java.sql.SQLException)
,
removeConnectionEventListener(javax.sql.ConnectionEventListener)
public void close() throws java.sql.SQLException
close
in interface javax.sql.PooledConnection
java.sql.SQLException
- if an error occurspublic void fireConnectionEvent(boolean closed, java.sql.SQLException sqlException)
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 listenerspublic java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface javax.sql.PooledConnection
java.sql.SQLException
- if an error occurspublic void removeConnectionEventListener(javax.sql.ConnectionEventListener listener)
removeConnectionEventListener
in interface javax.sql.PooledConnection
addConnectionEventListener(javax.sql.ConnectionEventListener)
,
fireConnectionEvent(boolean, java.sql.SQLException)
public void addStatementEventListener(javax.sql.StatementEventListener listener)
addStatementEventListener
in interface javax.sql.PooledConnection
public void removeStatementEventListener(javax.sql.StatementEventListener listener)
removeStatementEventListener
in interface javax.sql.PooledConnection
Generated on June 8 2013