public class PGPooledConnection
extends java.lang.Object
implements javax.sql.PooledConnection
PGConnectionPoolDataSource| Constructor and Description |
|---|
PGPooledConnection(java.sql.Connection con,
boolean autoCommit) |
PGPooledConnection(java.sql.Connection con,
boolean autoCommit,
boolean isXA)
Creates a new PooledConnection representing the specified physical connection.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConnectionEventListener(javax.sql.ConnectionEventListener connectionEventListener)
Adds a listener for close or fatal error events on the connection handed out to a client.
|
void |
addStatementEventListener(javax.sql.StatementEventListener listener) |
void |
close()
Closes the physical database connection represented by this PooledConnection.
|
protected javax.sql.ConnectionEvent |
createConnectionEvent(java.sql.SQLException e) |
java.sql.Connection |
getConnection()
Gets a handle for a client to use.
|
void |
removeConnectionEventListener(javax.sql.ConnectionEventListener connectionEventListener)
Removes a listener for close or fatal error events on the connection handed out to a client.
|
void |
removeStatementEventListener(javax.sql.StatementEventListener listener) |
public PGPooledConnection(java.sql.Connection con,
boolean autoCommit,
boolean isXA)
con - connectionautoCommit - whether to autocommitisXA - whether connection is a XA connectionpublic PGPooledConnection(java.sql.Connection con,
boolean autoCommit)
public void addConnectionEventListener(javax.sql.ConnectionEventListener connectionEventListener)
addConnectionEventListener in interface javax.sql.PooledConnectionpublic void removeConnectionEventListener(javax.sql.ConnectionEventListener connectionEventListener)
removeConnectionEventListener in interface javax.sql.PooledConnectionpublic void close()
throws java.sql.SQLException
close in interface javax.sql.PooledConnectionjava.sql.SQLExceptionpublic java.sql.Connection getConnection()
throws java.sql.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 javax.sql.PooledConnectionjava.sql.SQLExceptionprotected javax.sql.ConnectionEvent createConnectionEvent(java.sql.SQLException e)
public void removeStatementEventListener(javax.sql.StatementEventListener listener)
removeStatementEventListener in interface javax.sql.PooledConnectionpublic void addStatementEventListener(javax.sql.StatementEventListener listener)
addStatementEventListener in interface javax.sql.PooledConnectionCopyright © 2021 PostgreSQL Global Development Group. All rights reserved.