Code example for PooledConnection

Methods: addConnectionEventListener

0
                throw new IllegalStateException("Connection pool data source returned null from getPooledConnection");
            } 
 
            // should we add this object as a listener or the pool. 
            // consider the validateObject method in decision 
            pc.addConnectionEventListener(this);
            obj = new PooledConnectionAndInfo(pc, _username, _password);
            pcMap.put(pc, obj);
        } catch (SQLException e) {
            throw new RuntimeException(e.getMessage());
        } 
        return obj;
    } 
 
    /** 
     * Closes the PooledConnection and stops listening for events from it. 
     */ 
    public void destroyObject(Object obj) throws Exception {
        if (obj instanceof PooledConnectionAndInfo) {
            PooledConnection pc = ((PooledConnectionAndInfo)obj).getPooledConnection();