| Modifier and Type | Field and Description |
|---|---|
| public static final int | CONNECTION_CLOSED_EVENT
The flag for a connection being closed. |
| public static final int | CONNECTION_ERROR_EVENT
The flag for an exception being thrown. |
| private Map | |
| private ExceptionInterceptor | |
| protected final Lock | |
| private Connection | |
| private JdbcConnection | |
| private final Map | |
| private final Lock |
| Access | Constructor and Description |
|---|---|
| public | MysqlPooledConnection(JdbcConnection
physical connection to db connection)Construct a new MysqlPooledConnection and set instance variables |
| Modifier and Type | Method and Description |
|---|---|
| public void | addConnectionEventListener(ConnectionEventListener
a component, usually the connection pool manager,
that has implemented the
connectioneventlistener)ConnectionEventListener interface and wants to be
notified when the connection is closed or has an errorImplements javax. Registers the given event listener so that it will be notified
when an event occurs on this |
| public void | addStatementEventListener(StatementEventListener
an component which implements the listener)StatementEventListener
interface that is to be registered with this PooledConnection objectImplements javax. Registers a |
| protected void | callConnectionEventListeners(int
value indicating whether connectionClosed or
connectionErrorOccurred called eventType, SQLException the exception being thrown sqlException)Notifies all registered ConnectionEventListeners of ConnectionEvents. |
| public void | close()
Implements javax. Invoked by the container (not the client), and should close the physical connection. |
| pack-priv void | |
| public Connection | getConnection()
Implements javax. Creates and returns a |
| protected Connection | |
| protected ExceptionInterceptor | |
| protected static MysqlPooledConnection | |
| public Lock | |
| public void | removeConnectionEventListener(ConnectionEventListener
a component, usually the connection pool manager,
that has implemented the
connectioneventlistener)ConnectionEventListener interface and
been registered with this PooledConnection object as
a listenerImplements javax. Removes the given event listener from the list of components that
will be notified when an event occurs on this
|
| public void | removeStatementEventListener(StatementEventListener
the component which implements the
listener)StatementEventListener interface that was previously
registered with this PooledConnection objectImplements javax. Removes the specified |
| CONNECTION_CLOSED_EVENT | back to summary |
|---|---|
| public static final int CONNECTION_CLOSED_EVENT The flag for a connection being closed. | |
| CONNECTION_ERROR_EVENT | back to summary |
|---|---|
| public static final int CONNECTION_ERROR_EVENT The flag for an exception being thrown. | |
| connectionEventListeners | back to summary |
|---|---|
| private Map<ConnectionEventListener, ConnectionEventListener> connectionEventListeners | |
| exceptionInterceptor | back to summary |
|---|---|
| private ExceptionInterceptor exceptionInterceptor | |
| lock | back to summary |
|---|---|
| protected final Lock lock | |
| logicalHandle | back to summary |
|---|---|
| private Connection logicalHandle | |
| physicalConn | back to summary |
|---|---|
| private JdbcConnection physicalConn | |
| statementEventListeners | back to summary |
|---|---|
| private final Map<StatementEventListener, StatementEventListener> statementEventListeners | |
| statementEventListenersLock | back to summary |
|---|---|
| private final Lock statementEventListenersLock | |
| MysqlPooledConnection | back to summary |
|---|---|
| public MysqlPooledConnection(JdbcConnection connection) Construct a new MysqlPooledConnection and set instance variables
| |
| addConnectionEventListener | back to summary |
|---|---|
| public void addConnectionEventListener(ConnectionEventListener connectioneventlistener) Implements javax. Doc from javax. Registers the given event listener so that it will be notified
when an event occurs on this
| |
| addStatementEventListener | back to summary |
|---|---|
| public void addStatementEventListener(StatementEventListener listener) Implements javax. Doc from javax. Registers a
| |
| callConnectionEventListeners | back to summary |
|---|---|
| protected void callConnectionEventListeners(int eventType, SQLException sqlException) Notifies all registered ConnectionEventListeners of ConnectionEvents. Instantiates a new ConnectionEvent which wraps sqlException and invokes either connectionClose or connectionErrorOccurred on listener as appropriate.
| |
| close | back to summary |
|---|---|
| public void close() throws SQLException Implements javax. 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.
| |
| fireStatementEvent | back to summary |
|---|---|
| pack-priv void fireStatementEvent(StatementEvent event) throws SQLException | |
| getConnection | back to summary |
|---|---|
| public Connection getConnection() throws SQLException Implements javax. Doc from javax. Creates and returns a
| |
| getConnection | back to summary |
|---|---|
| protected Connection getConnection(boolean resetServerState, boolean forXa) throws SQLException | |
| getExceptionInterceptor | back to summary |
|---|---|
| protected ExceptionInterceptor getExceptionInterceptor() | |
| getInstance | back to summary |
|---|---|
| protected static MysqlPooledConnection getInstance(JdbcConnection connection) throws SQLException | |
| getLock | back to summary |
|---|---|
| public Lock getLock() | |
| removeConnectionEventListener | back to summary |
|---|---|
| public void removeConnectionEventListener(ConnectionEventListener connectioneventlistener) Implements javax. Doc from javax. Removes the given event listener from the list of components that
will be notified when an event occurs on this
| |
| removeStatementEventListener | back to summary |
|---|---|
| public void removeStatementEventListener(StatementEventListener listener) Implements javax. Doc from javax. Removes the specified
| |