@Deprecated public abstract class AbstractPingablePooledConnection extends java.lang.Object implements javax.sql.PooledConnection, PooledObject, XStatementManager
PooledConnection
interface.Modifier and Type | Field and Description |
---|---|
protected java.sql.Connection |
jdbcConnection
Deprecated.
|
INSTANT_IN_USE
Modifier | Constructor and Description |
---|---|
protected |
AbstractPingablePooledConnection(java.sql.Connection connection,
boolean statementPooling,
int maxStatements,
boolean keepStatements,
org.firebirdsql.pool.PooledConnectionQueue owningQueue)
Deprecated.
|
protected |
AbstractPingablePooledConnection(java.sql.Connection connection,
java.lang.String pingStatement,
int pingInterval,
boolean statementPooling,
int maxStatements,
boolean keepStatements,
org.firebirdsql.pool.PooledConnectionQueue owningQueue)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addConnectionEventListener(javax.sql.ConnectionEventListener listener)
Deprecated.
Add connection listener to be notified about connection events.
|
void |
close()
Deprecated.
Close this pooled connection.
|
protected void |
configureConnectionDefaults(java.sql.Connection connection)
Deprecated.
Configure default values for this connection.
|
void |
connectionClosed(org.firebirdsql.pool.PooledConnectionHandler connection)
Deprecated.
Notify connection owner about invocation of the
Connection.close()
operation on PooledConnectionHandler instance. |
void |
connectionCommitted(org.firebirdsql.pool.PooledConnectionHandler connection)
Deprecated.
Notify this class that transaction was committed.
|
void |
connectionErrorOccured(org.firebirdsql.pool.PooledConnectionHandler connection,
java.sql.SQLException ex)
Deprecated.
Notify connection owner about the
SQLException that happened
during method invocation on the wrapped connection. |
void |
connectionRolledBack(org.firebirdsql.pool.PooledConnectionHandler connection)
Deprecated.
Notify this class that transaction was rolled back.
|
void |
deallocate()
Deprecated.
Deallocate this object.
|
java.sql.Connection |
getConnection()
Deprecated.
Get JDBC connection corresponding to this pooled connection instance.
|
long |
getInstantInPool()
Deprecated.
|
long |
getLastPingTime()
Deprecated.
Get the time when connection was pinged last time.
|
protected org.firebirdsql.logging.Logger |
getLogChannel()
Deprecated.
|
org.firebirdsql.pool.PooledConnectionQueue |
getOwningQueue()
Deprecated.
|
java.sql.PreparedStatement |
getPreparedStatement(java.lang.String statement,
int[] keyIndexes,
java.lang.String[] keyColumns)
Deprecated.
Prepare specified SQL statement that will return the generated keys.
|
java.sql.PreparedStatement |
getPreparedStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
Deprecated.
Get instance of
PreparedStatement for the specified SQL statement. |
java.sql.PreparedStatement |
getPreparedStatement(java.lang.String statement,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Deprecated.
Handle
Connection.prepareStatement(String) method call. |
protected void |
internalClose()
Deprecated.
Close this connection.
|
boolean |
isInPool()
Deprecated.
Check whether this object is currently in pool or had been released
to the application.
|
boolean |
isKeepStatements()
Deprecated.
|
protected boolean |
isRollbackAllowed()
Deprecated.
Is calling rollback on the physical connection allowed when the logical connection close is signalled.
|
boolean |
isStatementPooling()
Deprecated.
|
boolean |
isValid()
Deprecated.
Check if this pooled connection is still valid.
|
boolean |
isValid(org.firebirdsql.pool.PooledConnectionHandler connection)
Deprecated.
Check if specified connection is still valid.
|
boolean |
ping()
Deprecated.
Ping connection by executing a ping statement.
|
org.firebirdsql.pool.XCachablePreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
boolean cached)
Deprecated.
use
prepareStatement(XPreparedStatementModel, boolean)
instead. |
org.firebirdsql.pool.XCachablePreparedStatement |
prepareStatement(XPreparedStatementModel key,
boolean cached)
Deprecated.
Prepare the specified statement and wrap it with cache notification
wrapper.
|
void |
removeConnectionEventListener(javax.sql.ConnectionEventListener listener)
Deprecated.
Remove connection listener from this pooled connection.
|
void |
setDefaultTransactionIsolation(int isolation)
Deprecated.
|
void |
setInPool(boolean inPool)
Deprecated.
Set the "inPool" flag to this object.
|
void |
statementClosed(java.lang.String sql,
java.lang.Object proxy)
Deprecated.
Notify about statement close.
|
void |
statementClosed(XPreparedStatementModel key,
java.lang.Object proxy)
Deprecated.
Handle
Statement.close() method. |
protected AbstractPingablePooledConnection(java.sql.Connection connection, boolean statementPooling, int maxStatements, boolean keepStatements, org.firebirdsql.pool.PooledConnectionQueue owningQueue) throws java.sql.SQLException
java.sql.SQLException
protected AbstractPingablePooledConnection(java.sql.Connection connection, java.lang.String pingStatement, int pingInterval, boolean statementPooling, int maxStatements, boolean keepStatements, org.firebirdsql.pool.PooledConnectionQueue owningQueue) throws java.sql.SQLException
java.sql.SQLException
protected org.firebirdsql.logging.Logger getLogChannel()
public void setDefaultTransactionIsolation(int isolation)
public long getLastPingTime()
public boolean isStatementPooling()
public boolean isKeepStatements()
public boolean ping()
true
if connection was successfully pinged.public boolean isValid()
isValid
in interface PooledObject
true
if this pooled connection is still valid.public boolean isInPool()
isInPool
in interface PooledObject
true
if the object is currently in pool.public void setInPool(boolean inPool)
setInPool
in interface PooledObject
inPool
- true
if object is in pool, otherwise
false
.public long getInstantInPool()
getInstantInPool
in interface PooledObject
PooledObject.INSTANT_IN_USE
when object is currently in use.public void addConnectionEventListener(javax.sql.ConnectionEventListener listener)
addConnectionEventListener
in interface javax.sql.PooledConnection
listener
- listener to add.public void removeConnectionEventListener(javax.sql.ConnectionEventListener listener)
removeConnectionEventListener
in interface javax.sql.PooledConnection
listener
- listener to remove.public void close() throws java.sql.SQLException
close
in interface javax.sql.PooledConnection
java.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.PooledConnection
Connection
java.sql.SQLException
- if some error happened.protected void configureConnectionDefaults(java.sql.Connection connection) throws java.sql.SQLException
connection
- instance of Connection
to configure.java.sql.SQLException
- if something went wrong.public java.sql.PreparedStatement getPreparedStatement(java.lang.String statement, int resultSetType, int resultSetConcurrency, int resultSetHoldability) 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.statement
- statement to prepare.resultSetType
- result set type.resultSetConcurrency
- result set concurrency.resultSetHoldability
- result set holdability.PreparedStatement
corresponding to the
statement
.java.sql.SQLException
- if there was problem preparing statement.public java.sql.PreparedStatement getPreparedStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
PreparedStatement
for the specified SQL statement.
Default implementation would call
Connection.prepareStatement(String, int, int)
on physical
connection. However it is also possible to implement prepared statement
pooling for increased performance.sql
- SQL statement for which prepared statement must be constructed.resultSetType
- type of the result set.resultSetConcurrency
- result set concurrency.PreparedStatement
corresponding to the
specified SQL statement.java.sql.SQLException
- if prepared statement cannot be obtained.public java.sql.PreparedStatement getPreparedStatement(java.lang.String statement, int[] keyIndexes, java.lang.String[] keyColumns) throws java.sql.SQLException
Connection.prepareStatement(String, int)
Connection.prepareStatement(String, int[])
Connection.prepareStatement(String, String[])
statement
- SQL statement for which prepared statement must be constructed.keyIndexes
- - array of key column indexes if they were specified or
null
in other cases.keyColumns
- - array of key column names if they were specified or
null
in other cases.PreparedStatement
corresponding to the
specified SQL statement.java.sql.SQLException
- if prepared statement cannot be obtained.public org.firebirdsql.pool.XCachablePreparedStatement prepareStatement(XPreparedStatementModel key, boolean cached) throws java.sql.SQLException
prepareStatement
in interface XStatementManager
key
- Statement model of the statement to preparecached
- true
if prepared statement will be cachedjava.sql.SQLException
- if underlying connection threw this exception.Connection.prepareStatement(java.lang.String, int, int, int)
public org.firebirdsql.pool.XCachablePreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency, boolean cached) throws java.sql.SQLException
prepareStatement(XPreparedStatementModel, boolean)
instead.Connection.prepareStatement(String)
method on physical JDBC
connection.prepareStatement
in interface XStatementManager
sql
- SQL statement to prepare.resultSetType
- type of result setresultSetConcurrency
- result set concurrencycached
- true
if prepared statement will be cached.PreparedStatement
corresponding to the
specified SQL statement.java.sql.SQLException
- if something went wrong.Connection.prepareStatement(java.lang.String, int, int)
public void statementClosed(java.lang.String sql, java.lang.Object proxy) throws java.sql.SQLException
XStatementManager
statementClosed
in interface XStatementManager
sql
- SQL statement of an object that is being closed.proxy
- proxy on which Statement.close()
method was called.java.sql.SQLException
- if something went wrong.public void statementClosed(XPreparedStatementModel key, java.lang.Object proxy) throws java.sql.SQLException
Statement.close()
method. This implementation
dereferences proxy in cache.statementClosed
in interface XStatementManager
key
- Statement model of the statement to prepareproxy
- proxy wrapping the connection.java.sql.SQLException
- if prepared statement cannot be added to the pool.protected boolean isRollbackAllowed()
Reason to return false
is when the physical connection is participating in a distributed connection.
true
when calling rollback is allowed, false
otherwisepublic void connectionClosed(org.firebirdsql.pool.PooledConnectionHandler connection) throws java.sql.SQLException
Connection.close()
operation on PooledConnectionHandler
instance.connection
- instance of PooledConnectionHandler
that
initiated the call.java.sql.SQLException
public void connectionErrorOccured(org.firebirdsql.pool.PooledConnectionHandler connection, java.sql.SQLException ex)
SQLException
that happened
during method invocation on the wrapped connection.connection
- instance of PooledConnectionHandler
that
catched exception.ex
- instance of SQLException
that was thrown.public boolean isValid(org.firebirdsql.pool.PooledConnectionHandler connection)
connection
- 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
connection
- connection that was commited.java.sql.SQLException
XConnectionManager.connectionCommitted(PooledConnectionHandler)
public void connectionRolledBack(org.firebirdsql.pool.PooledConnectionHandler connection) throws java.sql.SQLException
connection
- connection that was commited.java.sql.SQLException
XConnectionManager.connectionRolledBack(PooledConnectionHandler)
public org.firebirdsql.pool.PooledConnectionQueue getOwningQueue()
getOwningQueue
in interface PooledObject
Copyright © 2001-2019 Jaybird (Firebird JDBC/JCA) team. All rights reserved.