public abstract class AbstractPooledConnection
extends java.lang.Object
implements javax.sql.PooledConnection
FBConnectionPoolDataSource
This class is abstract to account for both a JDBC 3.0 and JDBC 4.0 compliant implementation.
Modifier and Type | Field and Description |
---|---|
protected java.sql.Connection |
connection |
protected org.firebirdsql.ds.PooledConnectionHandler |
handler |
Modifier | Constructor and Description |
---|---|
protected |
AbstractPooledConnection(java.sql.Connection connection) |
Modifier and Type | Method and Description |
---|---|
void |
addConnectionEventListener(javax.sql.ConnectionEventListener listener) |
void |
close() |
protected org.firebirdsql.ds.PooledConnectionHandler |
createConnectionHandler()
Creates the PooledConnectionHandler for the connection.
|
protected void |
fireConnectionClosed()
Helper method to fire the connectionClosed event.
|
protected void |
fireConnectionError(java.sql.SQLException ex)
Helper method to fire the connectionErrorOccurred event.
|
protected void |
fireFatalConnectionError(java.sql.SQLException ex)
Helper method to fire the connectionErrorOccurred event.
|
java.sql.Connection |
getConnection() |
protected void |
releaseConnectionHandler(org.firebirdsql.ds.PooledConnectionHandler pch)
Releases the current handler if it is equal to the handler passed in
pch . |
void |
removeConnectionEventListener(javax.sql.ConnectionEventListener listener) |
protected void |
resetConnection() |
protected java.sql.Connection connection
protected volatile org.firebirdsql.ds.PooledConnectionHandler handler
protected AbstractPooledConnection(java.sql.Connection connection)
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface javax.sql.PooledConnection
java.sql.SQLException
protected void resetConnection() throws java.sql.SQLException
java.sql.SQLException
protected org.firebirdsql.ds.PooledConnectionHandler createConnectionHandler()
Subclasses may override this method to return their own subclass of PooledConnectionHandler.
public void close() throws java.sql.SQLException
close
in interface javax.sql.PooledConnection
java.sql.SQLException
protected void fireFatalConnectionError(java.sql.SQLException ex)
ex
- The exceptionprotected void fireConnectionError(java.sql.SQLException ex)
This method will decide which errors warrant a connectionErrorOccurred event to be reported or not.
ex
- The exceptionprotected void fireConnectionClosed()
protected void releaseConnectionHandler(org.firebirdsql.ds.PooledConnectionHandler pch)
pch
.
To be called by the PooledConnectionHandler when it has been closed.
pch
- PooledConnectionHandler to release.public void addConnectionEventListener(javax.sql.ConnectionEventListener listener)
addConnectionEventListener
in interface javax.sql.PooledConnection
public void removeConnectionEventListener(javax.sql.ConnectionEventListener listener)
removeConnectionEventListener
in interface javax.sql.PooledConnection
Copyright © 2001-2019 Jaybird (Firebird JDBC/JCA) team. All rights reserved.