这样理解不正确,你必须在程序中完成连接的close()
例如:
try{}catch(){
}

解决方案 »

  1.   

    这样理解不正确,你必须在程序中完成连接的close()
    例如:
    try{
        con=getConnection();}catch(){
    }
      

  2.   

    不好意思!!!!
    这样理解不正确,你必须在程序中完成连接的close()
    例如:
    try{
        con=getConnection();
         pstmt=con.PrepareStatement(sql);
    }catch(){
    }finally{
         if(pstmt!=null) pstmt.close();//使用finally来关闭连接
         if(con!=null) con.close();
    }
      

  3.   

    如果使用了连接池,那么con.close()只是把连接unlock,并放回连接池中
    给其它的程序用,如果是真正的关掉,那要连接池做什么。