public class MysqlPooledConnection
extends java.lang.Object
implements javax.sql.PooledConnection
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
MysqlPooledConnection(JdbcConnection connection)
Construct a new MysqlPooledConnection and set instance variables
|
Modifier and Type | Method and Description |
---|---|
void |
addConnectionEventListener(javax.sql.ConnectionEventListener connectioneventlistener) |
void |
addStatementEventListener(javax.sql.StatementEventListener listener) |
protected void |
callConnectionEventListeners(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() |
protected java.sql.Connection |
getConnection(boolean resetServerState,
boolean forXa) |
protected ExceptionInterceptor |
getExceptionInterceptor() |
protected static MysqlPooledConnection |
getInstance(JdbcConnection connection) |
void |
removeConnectionEventListener(javax.sql.ConnectionEventListener connectioneventlistener) |
void |
removeStatementEventListener(javax.sql.StatementEventListener listener) |
public static final int CONNECTION_ERROR_EVENT
public static final int CONNECTION_CLOSED_EVENT
public MysqlPooledConnection(JdbcConnection connection)
connection
- physical connection to dbprotected static MysqlPooledConnection getInstance(JdbcConnection connection) throws java.sql.SQLException
java.sql.SQLException
public void addConnectionEventListener(javax.sql.ConnectionEventListener connectioneventlistener)
addConnectionEventListener
in interface javax.sql.PooledConnection
public void removeConnectionEventListener(javax.sql.ConnectionEventListener connectioneventlistener)
removeConnectionEventListener
in interface javax.sql.PooledConnection
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface javax.sql.PooledConnection
java.sql.SQLException
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
protected void callConnectionEventListeners(int eventType, java.sql.SQLException sqlException)
eventType
- value indicating whether connectionClosed or
connectionErrorOccurred calledsqlException
- the exception being thrownprotected ExceptionInterceptor getExceptionInterceptor()
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