/** * 将连接对象返回给由名字指定的连接池 * * @param name 在属性文件中定义的连接池ID名字 * @param con 连接对象 */ public void freeConnection(int id, Connection con) { DBConnectionPool pool = (DBConnectionPool) pools.get(new Integer(id)); if (pool != null) { pool.freeConnection(con); } else { System.out.println("pool ==null"); } clients--; }
// 将连接对象返回给由名字指定的连接池 public void freeConnection(String name, Connection con) { DBConnectionPool pool = (DBConnectionPool) pools.get(name); if (pool != null) { pool.freeConnection(con); } }