public class XgPooledConnection extends Object implements PooledConnection
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
CONNECTION_CLOSED_EVENT |
static int |
CONNECTION_ERROR_EVENT |
protected Connection |
logicalConn |
protected Connection |
physicalConn |
protected Vector<StatementEventListener> |
statementListener |
| 构造器和说明 |
|---|
XgPooledConnection() |
XgPooledConnection(Connection conn,
boolean autoComm) |
XgPooledConnection(Connection conn,
Properties pro) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addConnectionEventListener(ConnectionEventListener listener)
注册给定的事件侦听器,以便在此 PooledConnection 对象上发生事件时它将得到通知。
|
void |
addStatementEventListener(StatementEventListener listener) |
void |
close()
关闭PooledConnection时,先关闭连接池中所有连接,再关闭物理的连接
|
void |
freeConnection(Connection con)
关闭连接迟中的连接(并非关闭连接池),释放掉连接,并将该连接放回连接池,请求数-1
|
Connection |
getConnection() |
ConnectionWrapper |
getConnection(long timeout)
该函数用于处理等待连接出现超时的问题
|
void |
removeConnectionEventListener(ConnectionEventListener listener) |
void |
removeStatementEventListener(StatementEventListener listener) |
protected Vector<StatementEventListener> statementListener
protected Connection physicalConn
protected Connection logicalConn
public static final int CONNECTION_CLOSED_EVENT
public static final int CONNECTION_ERROR_EVENT
public XgPooledConnection()
public XgPooledConnection(Connection conn, boolean autoComm) throws SQLException
SQLExceptionpublic XgPooledConnection(Connection conn, Properties pro)
public void addConnectionEventListener(ConnectionEventListener listener)
addConnectionEventListener 在接口中 PooledConnectionpublic void addStatementEventListener(StatementEventListener listener)
addStatementEventListener 在接口中 PooledConnectionpublic void close()
throws SQLException
close 在接口中 PooledConnectionSQLExceptionpublic Connection getConnection() throws SQLException
getConnection 在接口中 PooledConnectionSQLExceptionpublic ConnectionWrapper getConnection(long timeout)
public void removeConnectionEventListener(ConnectionEventListener listener)
public void removeStatementEventListener(StatementEventListener listener)
removeStatementEventListener 在接口中 PooledConnectionpublic void freeConnection(Connection con)
Copyright © 2025. All rights reserved.