public abstract class ClientPooledConnection extends Object implements PooledConnection
| Modifier and Type | Field and Description |
|---|---|
protected LogWriter |
logWriter_ |
protected int |
rmId_
Resource manager identificator.
|
| Constructor and Description |
|---|
ClientPooledConnection(ClientBaseDataSource ds,
LogWriter logWriter,
String user,
String password)
Constructor for non-XA pooled connections.
|
ClientPooledConnection(ClientBaseDataSource ds,
LogWriter logWriter,
String user,
String password,
int rmId)
Constructor for XA pooled connections only.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConnectionEventListener(ConnectionEventListener listener) |
void |
close()
Closes the physical connection to the data source and frees all
assoicated resources.
|
protected void |
finalize() |
Connection |
getConnection()
Creates a logical connection.
|
protected NetXAConnection |
getNetXAConnection(ClientBaseDataSource ds,
NetLogWriter logWriter,
String user,
String password,
int rmId)
creates and returns NetXAConnection.
|
void |
informListeners(SqlException exception)
Inform listeners that an error has occured on the connection, if the
error severity is high enough.
|
boolean |
isStatementPoolingEnabled()
Tells is statement pooling is enabled or not.
|
void |
nullLogicalConnection()
Used by
LogicalConnection.close in some circumstances when
it disassociates itself from the pooled connection. |
void |
onStatementClose(PreparedStatement statement)
The onStatementClose contains the logic for raising the Statement Closed
events.
|
void |
onStatementErrorOccurred(PreparedStatement statement,
SQLException sqle)
The method contains the logic for raising the Statement error occurred
events.
|
void |
recycleConnection()
Inform listeners that the logical connection has been closed and that the
physical connection is ready for reuse.
|
void |
removeConnectionEventListener(ConnectionEventListener listener) |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddStatementEventListener, removeStatementEventListenerprotected LogWriter logWriter_
protected int rmId_
public ClientPooledConnection(ClientBaseDataSource ds, LogWriter logWriter, String user, String password) throws SQLException
Using standard Java APIs, a CPDS is passed in. Arguments for user/password overrides anything on the data source.
ds - data source creating this pooled connectionlogWriter - destination for log messagesuser - user namepassword - user passwordSQLException - if creating the pooled connection fails due problems
in the database, or problems communicating with the databasepublic ClientPooledConnection(ClientBaseDataSource ds, LogWriter logWriter, String user, String password, int rmId) throws SQLException
Using standard Java APIs, a CPDS is passed in. Arguments for user/password overrides anything on the data source.
ds - data source creating this pooled connectionlogWriter - destination for log messagesuser - user namepassword - user passwordrmId - resource manager idSQLException - if creating the pooled connection fails due problems
in the database, or problems communicating with the databasepublic boolean isStatementPoolingEnabled()
true if enabled, false if disabled.protected void finalize()
throws Throwable
public void close()
throws SQLException
close in interface PooledConnectionSQLException - if closing the connection causes an error. Note that
this connection can still be considered closed even if an error
occurs.public Connection getConnection() throws SQLException
This is the standard API for getting a logical connection handle for a pooled connection. No "resettable" properties are passed, so user, password, and all other properties may not change.
getConnection in interface PooledConnectionSQLException - if creating a new logical connection failspublic void addConnectionEventListener(ConnectionEventListener listener)
addConnectionEventListener in interface PooledConnectionpublic void removeConnectionEventListener(ConnectionEventListener listener)
removeConnectionEventListener in interface PooledConnectionpublic void recycleConnection()
Not public, but needs to be visible to am.LogicalConnection
public void informListeners(SqlException exception)
Not public, but needs to be visible to am.LogicalConnection
exception - the exception that occurred on the connectionpublic void nullLogicalConnection()
LogicalConnection.close in some circumstances when
it disassociates itself from the pooled connection.public void onStatementClose(PreparedStatement statement)
statement - The PreparedStatement that was closedpublic void onStatementErrorOccurred(PreparedStatement statement, SQLException sqle)
statement - The PreparedStatement that was closedsqle - The SQLException associated with the error that caused
the invalidation of this PreparedStatementprotected NetXAConnection getNetXAConnection(ClientBaseDataSource ds, NetLogWriter logWriter, String user, String password, int rmId) throws SqlException
ds - logWriter - user - password - rmId - SqlExceptionCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.