Connection testConnection = testPool.getPooledConnection().getConnection();
    protected void checkJNDI(Properties env) throws Exception {        Context context = new InitialContext(env);        try {            context.bind("jdbc/test", pool);                        BasicAbstractConnectionPool testPool =                 (BasicAbstractConnectionPool)context.lookup("jdbc/test");            Connection testConnection =                 testPool.getPooledConnection().getConnection();            try {                Statement stmt = testConnection.createStatement();                try {                    ResultSet rs = stmt.executeQuery("SELECT 1 FROM rdb$database");                    assertTrue("Result set should have at least one row.", rs.next());                    assertTrue("Should return correct value", rs.getInt(1) == 1);                    assertTrue("Result set should have only one row.", !rs.next());                } finally {                    stmt.close();                }            } finally {                testConnection.close();            }                    } finally {            context.unbind("jdbc/test");        }    }