|
MySQL Connector/J size='-1'>5.0.8 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mysql.jdbc.jdbc2.optional.MysqlPooledConnection
public class 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
PooledConnection
,
org.gjt.mm.mysql.jdbc2.optional.LogicalHandle
Field Summary | |
---|---|
static int |
CONNECTION_CLOSED_EVENT
The flag for a connection being closed. |
static int |
CONNECTION_ERROR_EVENT
The flag for an exception being thrown. |
Constructor Summary | |
---|---|
MysqlPooledConnection(Connection connection)
Construct a new MysqlPooledConnection and set instance variables |
Method Summary | |
---|---|
void |
addConnectionEventListener(javax.sql.ConnectionEventListener connectioneventlistener)
Adds ConnectionEventListeners to a hash table to be used for notification of ConnectionEvents |
protected void |
callListener(int eventType,
java.sql.SQLException sqlException)
Notifies all registered ConnectionEventListeners of ConnectionEvents. |
void |
close()
Invoked by the container (not the client), and should close the physical connection. |
java.sql.Connection |
getConnection()
Invoked by the container. |
protected java.sql.Connection |
getConnection(boolean resetServerState,
boolean forXa)
|
void |
removeConnectionEventListener(javax.sql.ConnectionEventListener connectioneventlistener)
Removes ConnectionEventListeners from hash table used for notification of ConnectionEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int CONNECTION_ERROR_EVENT
public static final int CONNECTION_CLOSED_EVENT
Constructor Detail |
---|
public MysqlPooledConnection(Connection connection)
connection
- physical connection to dbMethod Detail |
---|
public void addConnectionEventListener(javax.sql.ConnectionEventListener connectioneventlistener)
addConnectionEventListener
in interface javax.sql.PooledConnection
connectioneventlistener
- listener to be notified with ConnectionEventspublic void removeConnectionEventListener(javax.sql.ConnectionEventListener connectioneventlistener)
removeConnectionEventListener
in interface javax.sql.PooledConnection
connectioneventlistener
- listener to be removedpublic java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface javax.sql.PooledConnection
java.sql.SQLException
java.sql.DataSource#getConnection()
protected java.sql.Connection getConnection(boolean resetServerState, boolean forXa) throws java.sql.SQLException
java.sql.SQLException
public void close() throws java.sql.SQLException
close
in interface javax.sql.PooledConnection
java.sql.SQLException
java.sql.DataSource#close()
protected void callListener(int eventType, java.sql.SQLException sqlException)
eventType
- value indicating whether connectionClosed or
connectionErrorOccurred calledsqlException
- the exception being thrown
|
MySQL Connector/J size='-1'>5.0.8 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |