PooledConnection
for use by connection pooling software.The class maintains a lifetime connection to the database. The getConnection() method establishes a lease on the lifetime connection and returns a special JDBCConnection (userConnection) that is valid until it is closed.
This class uses a dedicated HyperSQL method to guarantee each lease on the connection starts with the original state of the connection.
The ConnectionEventLister objects that have been registered with this PooledConnection are notified when each lease expires, or an unrecoverable error occurs on the connection to the database.
| Modifier and Type | Field and Description |
|---|---|
| protected JDBCConnection | |
| protected boolean | |
| protected OrderedHashSet | |
| protected JDBCConnection |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addConnectionEventListener(ConnectionEventListener listener)
Implements javax. Registers the given event listener so that it will be notified
when an event occurs on this |
| public void | addStatementEventListener(StatementEventListener listener)
Implements javax. Registers a |
| public void | close()
Implements javax. Closes the physical connection that this |
| public synchronized void | |
| public synchronized void | |
| public synchronized Connection | getConnection()
Implements javax. Creates and returns a |
| public synchronized boolean | |
| public synchronized void | |
| public void | removeConnectionEventListener(ConnectionEventListener listener)
Implements 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 listener)
Implements javax. Removes the specified |
| public synchronized void |
| connection | back to summary |
|---|---|
| protected JDBCConnection connection | |
| isInUse | back to summary |
|---|---|
| protected boolean isInUse | |
| listeners | back to summary |
|---|---|
| protected OrderedHashSet<ConnectionEventListener> listeners | |
| userConnection | back to summary |
|---|---|
| protected JDBCConnection userConnection | |
| JDBCPooledConnection | back to summary |
|---|---|
| public JDBCPooledConnection(JDBCConnection connection) | |
| addConnectionEventListener | back to summary |
|---|---|
| public void addConnectionEventListener(ConnectionEventListener listener) 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 | |
| close | back to summary |
|---|---|
| public void close() throws SQLException Implements javax. Doc from javax. Closes the physical connection that this
See the
| |
| connectionClosed | back to summary |
|---|---|
| public synchronized void connectionClosed() Implements org. | |
| connectionErrorOccurred | back to summary |
|---|---|
| public synchronized void connectionErrorOccurred(SQLException e) Implements org. | |
| getConnection | back to summary |
|---|---|
| public synchronized Connection getConnection() throws SQLException Implements javax. Doc from javax. Creates and returns a
| |
| isInUse | back to summary |
|---|---|
| public synchronized boolean isInUse() Returns true if getConnection() has been called and a leas has been given.
| |
| release | back to summary |
|---|---|
| public synchronized void release() Force close the userConnection, and connection, no close event is fired. | |
| removeConnectionEventListener | back to summary |
|---|---|
| public void removeConnectionEventListener(ConnectionEventListener listener) 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 | |
| reset | back to summary |
|---|---|
| public synchronized void reset() Force close the userConnection, no close event is fired. | |