Code example for PooledConnection

Methods: addConnectionEventListener

            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 
        pci = new PooledConnectionAndInfo(pc, username, password);
        pcMap.put(pc, pci);
        return new DefaultPooledObject<>(pci);
     * Closes the PooledConnection and stops listening for events from it. 
    public void destroyObject(UserPassKey key, PooledObject<PooledConnectionAndInfo> p)
            throws Exception { 
        PooledConnection pc = p.getObject().getPooledConnection();