com.mysql.jdbc.jdbc2.optional
Class JDBC4MysqlPooledConnection
java.lang.Object
com.mysql.jdbc.jdbc2.optional.MysqlPooledConnection
com.mysql.jdbc.jdbc2.optional.JDBC4MysqlPooledConnection
- All Implemented Interfaces:
- javax.sql.PooledConnection
public class JDBC4MysqlPooledConnection
- extends MysqlPooledConnection
This class is used to wrap and return a physical connection within a logical
handle. It also registers and notifies ConnectionEventListeners of any
ConnectionEvents
- Author:
- Todd Wolff
- See Also:
PooledConnection
,
org.gjt.mm.mysql.jdbc2.optional.LogicalHandle
Method Summary |
void |
addStatementEventListener(javax.sql.StatementEventListener listener)
Registers a StatementEventListener with this PooledConnection object. |
void |
close()
Invoked by the container (not the client), and should close the physical
connection. |
void |
removeStatementEventListener(javax.sql.StatementEventListener listener)
Removes the specified StatementEventListener from the list of
components that will be notified when the driver detects that a
PreparedStatement has been closed or is invalid. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JDBC4MysqlPooledConnection
public JDBC4MysqlPooledConnection(Connection connection)
close
public void close()
throws java.sql.SQLException
- Description copied from class:
MysqlPooledConnection
- Invoked by the container (not the client), and should close the physical
connection. This will be called if the pool is destroyed or the
connectionEventListener receives a connectionErrorOccurred event.
- Specified by:
close
in interface javax.sql.PooledConnection
- Overrides:
close
in class MysqlPooledConnection
- Throws:
java.sql.SQLException
- See Also:
java.sql.DataSource#close()
addStatementEventListener
public void addStatementEventListener(javax.sql.StatementEventListener listener)
- Registers a
StatementEventListener
with this PooledConnection
object. Components that
wish to be notified when PreparedStatement
s created by the
connection are closed or are detected to be invalid may use this method
to register a StatementEventListener
with this PooledConnection
object.
- Specified by:
addStatementEventListener
in interface javax.sql.PooledConnection
- Overrides:
addStatementEventListener
in class MysqlPooledConnection
- Parameters:
listener
- an component which implements the StatementEventListener
interface that is to be registered with this PooledConnection
object
- Since:
- 1.6
removeStatementEventListener
public void removeStatementEventListener(javax.sql.StatementEventListener listener)
- Removes the specified
StatementEventListener
from the list of
components that will be notified when the driver detects that a
PreparedStatement
has been closed or is invalid.
- Specified by:
removeStatementEventListener
in interface javax.sql.PooledConnection
- Overrides:
removeStatementEventListener
in class MysqlPooledConnection
- Parameters:
listener
- the component which implements the
StatementEventListener
interface that was previously
registered with this PooledConnection
object
- Since:
- 1.6