|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.firebirdsql.pool.PingablePooledConnection
This class implements PooledConnection interface.
| Field Summary | |
protected java.sql.Connection |
jdbcConnection
|
| Constructor Summary | |
protected |
PingablePooledConnection(java.sql.Connection connection,
boolean statementPooling,
int transactionIsolation,
int maxStatements,
boolean keepStatements)
|
protected |
PingablePooledConnection(java.sql.Connection connection,
java.lang.String pingStatement,
int pingInterval,
boolean statementPooling,
int transactionIsolation,
int maxStatements,
boolean keepStatements)
|
| Method Summary | |
void |
addConnectionEventListener(javax.sql.ConnectionEventListener listener)
Add connection listener to be notified about connection events. |
void |
close()
Close this pooled connection. |
void |
connectionClosed(org.firebirdsql.pool.PooledConnectionHandler connection)
Notify connection owner about invocation of the Connection.close()
operation on PooledConnectionHandler instance. |
void |
connectionCommitted(org.firebirdsql.pool.PooledConnectionHandler connection)
Notify this class that transaction was committed. |
void |
connectionErrorOccured(org.firebirdsql.pool.PooledConnectionHandler connection,
java.sql.SQLException ex)
Notify connection owner about the SQLException that happened
during method invocation on the wrapped connection. |
void |
connectionRolledBack(org.firebirdsql.pool.PooledConnectionHandler connection)
Notify this class that transaction was rolled back. |
void |
deallocate()
Deallocate this object. |
java.sql.Connection |
getConnection()
Get JDBC connection corresponding to this pooled connection instance. |
long |
getLastPingTime()
Get the time when connection was pinged last time. |
protected org.firebirdsql.logging.Logger |
getLogChannel()
|
java.sql.PreparedStatement |
getPreparedStatement(java.lang.String statement,
int resultSetType,
int resultSetConcurrency)
Handle Connection.prepareStatement(String) method call. |
protected void |
internalClose()
Close this connection. |
boolean |
isKeepStatements()
|
boolean |
isStatementPooling()
|
boolean |
isValid()
Check if this pooled connection is still valid. |
boolean |
isValid(org.firebirdsql.pool.PooledConnectionHandler connection)
Check if specified connection is still valid. |
boolean |
ping()
Ping connection by executing a ping statement. |
org.firebirdsql.pool.XCachablePreparedStatement |
prepareStatement(java.lang.String statement,
int resultSetType,
int resultSetConcurrency,
boolean cached)
Prepare the specified statement and wrap it with cache notification wrapper. |
void |
removeConnectionEventListener(javax.sql.ConnectionEventListener listener)
Remove connection listener from this pooled connection. |
void |
statementClosed(java.lang.String statement,
java.lang.Object proxy)
Handle Statement.close() method. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.sql.Connection jdbcConnection
| Constructor Detail |
protected PingablePooledConnection(java.sql.Connection connection,
boolean statementPooling,
int transactionIsolation,
int maxStatements,
boolean keepStatements)
throws java.sql.SQLException
protected PingablePooledConnection(java.sql.Connection connection,
java.lang.String pingStatement,
int pingInterval,
boolean statementPooling,
int transactionIsolation,
int maxStatements,
boolean keepStatements)
throws java.sql.SQLException
| Method Detail |
protected org.firebirdsql.logging.Logger getLogChannel()
public long getLastPingTime()
org.firebirdsql.pool.XConnectionManager
getLastPingTime in interface org.firebirdsql.pool.XConnectionManagerpublic boolean isStatementPooling()
public boolean isKeepStatements()
public boolean ping()
ping in interface org.firebirdsql.pool.XConnectionManagertrue if connection was successfully pinged.public boolean isValid()
isValid in interface PooledObjecttrue if this pooled connection is still valid.public void addConnectionEventListener(javax.sql.ConnectionEventListener listener)
addConnectionEventListener in interface javax.sql.PooledConnectionlistener - listener to add.public void removeConnectionEventListener(javax.sql.ConnectionEventListener listener)
removeConnectionEventListener in interface javax.sql.PooledConnectionlistener - listener to remove.
public void close()
throws java.sql.SQLException
close in interface javax.sql.PooledConnectionjava.sql.SQLException
protected void internalClose()
throws java.sql.SQLException
java.sql.SQLException - if something went wrong.public void deallocate()
deallocate in interface PooledObject
public java.sql.Connection getConnection()
throws java.sql.SQLException
getConnection in interface javax.sql.PooledConnectionConnection
java.sql.SQLException - if some error happened.
public java.sql.PreparedStatement getPreparedStatement(java.lang.String statement,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
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.XConnectionManagerstatement - statement to prepare.resultSetType - type of the result set.resultSetConcurrency - result set concurrency.
PreparedStatement corresponding to the
statement.
java.sql.SQLException - if there was problem preparing statement.
public org.firebirdsql.pool.XCachablePreparedStatement prepareStatement(java.lang.String statement,
int resultSetType,
int resultSetConcurrency,
boolean cached)
throws java.sql.SQLException
prepareStatement in interface XStatementManagerstatement - sattement to prepare.resultSetType - type of result setresultSetConcurrency - result set concurrencycached - true if prepared statement will be cached.
java.sql.SQLException - if underlying connection threw this exception.Connection.prepareStatement(java.lang.String, int, int)
public void statementClosed(java.lang.String statement,
java.lang.Object proxy)
throws java.sql.SQLException
Statement.close() method. This implementation
dereferences proxy in cache.
statementClosed in interface XStatementManagerstatement - SQL statement corresponding to the proxy.proxy - proxy wrapping the connection.
java.sql.SQLException - if prepared statement cannot be added to the pool.
public void connectionClosed(org.firebirdsql.pool.PooledConnectionHandler connection)
throws java.sql.SQLException
org.firebirdsql.pool.XConnectionManagerConnection.close()
operation on PooledConnectionHandler instance.
connectionClosed in interface org.firebirdsql.pool.XConnectionManagerconnection - instance of PooledConnectionHandler that
initiated the call.
java.sql.SQLException
public void connectionErrorOccured(org.firebirdsql.pool.PooledConnectionHandler connection,
java.sql.SQLException ex)
org.firebirdsql.pool.XConnectionManagerSQLException that happened
during method invocation on the wrapped connection.
connectionErrorOccured in interface org.firebirdsql.pool.XConnectionManagerconnection - instance of PooledConnectionHandler that
catched exception.ex - instance of SQLException that was thrown.public boolean isValid(org.firebirdsql.pool.PooledConnectionHandler connection)
org.firebirdsql.pool.XConnectionManager
isValid in interface org.firebirdsql.pool.XConnectionManagerconnection - instance of PooledConnectionHandler to check.
true if connection owner is still valid,
false otherwise.
public void connectionCommitted(org.firebirdsql.pool.PooledConnectionHandler connection)
throws java.sql.SQLException
connectionCommitted in interface org.firebirdsql.pool.XConnectionManagerconnection - connection that was commited.
java.sql.SQLExceptionXConnectionManager#connectionCommitted(PooledConnectionHandler)
public void connectionRolledBack(org.firebirdsql.pool.PooledConnectionHandler connection)
throws java.sql.SQLException
connectionRolledBack in interface org.firebirdsql.pool.XConnectionManagerconnection - connection that was commited.
java.sql.SQLExceptionXConnectionManager#connectionRolledBack(PooledConnectionHandler)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||