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);
        } catch (SQLException e) {
            throw new RuntimeException(e.getMessage());
        return new DefaultPooledObject<>(pci);
     * Closes the PooledConnection and stops listening for events from it. 
    public void destroyObject(PooledObject<PooledConnectionAndInfo> p) throws Exception {