PingablePooledConnection
protected PingablePooledConnection(Connection connection,
String pingStatement,
int pingInterval,
boolean statementPooling,
int maxStatements,
boolean keepStatements)
throws SQLException
PingablePooledConnection
protected PingablePooledConnection(Connection connection,
boolean statementPooling,
int maxStatements,
boolean keepStatements)
throws SQLException
addConnectionEventListener
public void addConnectionEventListener(ConnectionEventListener listener)
Add connection listener to be notified about connection events.
listener
- listener to add.
close
public void close()
throws SQLException
Close this pooled connection. This operation closes physical
connection to the database. Should not be called by applications
directly.
configureConnectionDefaults
protected void configureConnectionDefaults(Connection connection)
throws SQLException
Configure default values for this connection.
connection
- instance of Connection
to configure.
connectionClosed
public void connectionClosed(org.firebirdsql.pool.PooledConnectionHandler connection)
throws SQLException
- connectionClosed in interface org.firebirdsql.pool.XConnectionManager
connectionCommitted
public void connectionCommitted(org.firebirdsql.pool.PooledConnectionHandler connection)
throws SQLException
Notify this class that transaction was committed.
- connectionCommitted in interface org.firebirdsql.pool.XConnectionManager
connection
- connection that was commited.
XConnectionManager.connectionCommitted(PooledConnectionHandler)
connectionErrorOccured
public void connectionErrorOccured(org.firebirdsql.pool.PooledConnectionHandler connection,
SQLException ex)
- connectionErrorOccured in interface org.firebirdsql.pool.XConnectionManager
connectionRolledBack
public void connectionRolledBack(org.firebirdsql.pool.PooledConnectionHandler connection)
throws SQLException
Notify this class that transaction was rolled back.
- connectionRolledBack in interface org.firebirdsql.pool.XConnectionManager
connection
- connection that was commited.
XConnectionManager.connectionRolledBack(PooledConnectionHandler)
getConnection
public Connection getConnection()
throws SQLException
Get JDBC connection corresponding to this pooled connection instance.
getLastPingTime
public long getLastPingTime()
Get the time when connection was pinged last time.
- getLastPingTime in interface org.firebirdsql.pool.XConnectionManager
- getLastPingTime in interface org.firebirdsql.pool.XPingableConnection
getLogChannel
protected org.firebirdsql.logging.Logger getLogChannel()
getPreparedStatement
public PreparedStatement getPreparedStatement(String statement,
int resultSetType,
int resultSetConcurrency)
throws SQLException
Handle Connection.prepareStatement(String)
method call. This
method check internal cache first and returns prepared statement if found.
Otherwise, it prepares statement and caches it.
- getPreparedStatement in interface org.firebirdsql.pool.XConnectionManager
statement
- statement to prepare.
- instance of
PreparedStatement
corresponding to the
statement
.
internalClose
protected void internalClose()
throws SQLException
Close this connection.
isInPool
public boolean isInPool()
Check whether this object is currently in pool or had been released
to the application.
- isInPool in interface PooledObject
true
if the object is currently in pool.
isKeepStatements
public boolean isKeepStatements()
isStatementPooling
public boolean isStatementPooling()
isValid
public boolean isValid()
Check if this pooled connection is still valid.
- isValid in interface PooledObject
true
if this pooled connection is still valid.
isValid
public boolean isValid(org.firebirdsql.pool.PooledConnectionHandler connection)
- isValid in interface org.firebirdsql.pool.XConnectionManager
ping
public boolean ping()
Ping connection by executing a ping statement.
- ping in interface org.firebirdsql.pool.XConnectionManager
- ping in interface org.firebirdsql.pool.XPingableConnection
prepareStatement
public org.firebirdsql.pool.XCachablePreparedStatement prepareStatement(String statement,
int resultSetType,
int resultSetConcurrency,
boolean cached)
throws SQLException
Prepare the specified statement and wrap it with cache notification
wrapper.
- prepareStatement in interface XStatementManager
statement
- sattement to prepare.
- prepared and wrapped statement.
removeConnectionEventListener
public void removeConnectionEventListener(ConnectionEventListener listener)
Remove connection listener from this pooled connection.
listener
- listener to remove.
setDefaultTransactionIsolation
public void setDefaultTransactionIsolation(int isolation)
setInPool
public void setInPool(boolean inPool)
Set the "inPool" flag to this object. This method should be called only
by the pool implementation.
- setInPool in interface PooledObject
inPool
- true
if object is in pool, otherwise
false
.
statementClosed
public void statementClosed(String statement,
Object proxy)
throws SQLException
Handle java.sql.PreparedStatement.close()
method. This implementation
dereferences proxy in cache.
- statementClosed in interface XStatementManager
statement
- SQL statement corresponding to the proxy.proxy
- proxy wrapping the connection.