Example usage for javax.sql PooledConnection removeConnectionEventListener

List of usage examples for javax.sql PooledConnection removeConnectionEventListener

Introduction

In this page you can find the example usage for javax.sql PooledConnection removeConnectionEventListener.

Prototype

void removeConnectionEventListener(ConnectionEventListener listener);

Source Link

Document

Removes the given event listener from the list of components that will be notified when an event occurs on this PooledConnection object.

Usage

From source file:com.alibaba.wasp.jdbcx.JdbcConnectionPool.java

/**
 * INTERNAL//from   w ww .ja v  a 2s  .c o m
 */
public void connectionClosed(ConnectionEvent event) {
    PooledConnection pc = (PooledConnection) event.getSource();
    pc.removeConnectionEventListener(this);
    recycleConnection(pc);
}

From source file:org.enhydra.jdbc.pool.StandardPoolDataSource.java

/**
 * object specific work to kill the object
 *///from  w  ww .j a v  a2s .  c  o  m
public void expire(Object o) {
    log.debug("StandardPoolDataSource:expire expire a connection, remove from the pool");
    if (o == null)
        return;
    try {
        PooledConnection pooledCon = (PooledConnection) o;
        pooledCon.close(); // call close() of PooledConnection
        pooledCon.removeConnectionEventListener(this);
        log.debug("StandardPoolDataSource:expire close the connection");
    } catch (java.sql.SQLException e) {
        log.error("StandardPoolDataSource:expire Error java.sql.SQLException in StandardPoolDataSource:expire");
    }
}