public class PGPooledConnection extends Object implements PooledConnection
| Constructor and Description |
|---|
PGPooledConnection(PGConnectionImpl con,
boolean autoCommit,
boolean isXA)
Creates a new PooledConnection representing the specified physical
connection.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConnectionEventListener(ConnectionEventListener connectionEventListener) |
void |
addStatementEventListener(StatementEventListener statementEventListener) |
void |
close()
Closes the physical database connection represented by this
PooledConnection.
|
protected ConnectionEvent |
createConnectionEvent(SQLException sqle) |
protected StatementEvent |
createStatementEvent(PreparedStatement ps,
SQLException sqle) |
void |
fireConnectionError(SQLException e)
Fires a connection error event, but only if we
think the exception is fatal.
|
Connection |
getConnection()
Gets a handle for a client to use.
|
void |
removeConnectionEventListener(ConnectionEventListener connectionEventListener) |
void |
removeStatementEventListener(StatementEventListener statementEventListener) |
public PGPooledConnection(PGConnectionImpl con, boolean autoCommit, boolean isXA)
public void addConnectionEventListener(ConnectionEventListener connectionEventListener)
addConnectionEventListener in interface PooledConnectionpublic void removeConnectionEventListener(ConnectionEventListener connectionEventListener)
removeConnectionEventListener in interface PooledConnectionpublic void addStatementEventListener(StatementEventListener statementEventListener)
addStatementEventListener in interface PooledConnectionpublic void removeStatementEventListener(StatementEventListener statementEventListener)
removeStatementEventListener in interface PooledConnectionpublic void close()
throws SQLException
close in interface PooledConnectionSQLExceptionpublic Connection getConnection() throws SQLException
According to the JDBC 2.0 Optional Package spec (6.2.3), only one client may have an active handle to the connection at a time, so if there is a previous handle active when this is called, the previous one is forcibly closed and its work rolled back.
getConnection in interface PooledConnectionSQLExceptionprotected ConnectionEvent createConnectionEvent(SQLException sqle)
public void fireConnectionError(SQLException e)
e - the SQLException to considerprotected StatementEvent createStatementEvent(PreparedStatement ps, SQLException sqle)
Copyright © 2013–2017 impossibl.com. All rights reserved.