stmt.close();
should be in a try/catch block

解决方案 »

  1.   

    应该这样写:Connection conF = con.getConnection();
    Statement stmt = null;
    try{
    conF.setAutoCommit(false);
    stmt = conF.createStatement(); stmt.executeUpdate(strSql_0);
    stmt.executeUpdate(strSql_1);
    stmt.executeUpdate(strSql_2);
    stmt.executeUpdate(strSql_3);

    conF.commit();  
                      conF.setAutoCommit(true);   //add by roger2008
                   
    }catch(Exception e){
    conF.rollback();
    out.println("删除异常!");
    }finally{
                
                 try {
                     if(stmt!=null)
    stmt.close();
                      if(conF!=null)        //modified by roger2008
    conF.close();
    con.close();      // ?????????
                 } catch(Exception e){
     
                 }         }先关stmt,后关conF,不明白con是什么类,是缓冲池吗?为什么要con.close()?