jsp 记录集为空 try块一定要close时的办法

来源:互联网 发布:php fsockopen 开启 编辑:程序博客网 时间:2024/06/01 08:17
<%
    rs.next();
    i++;
 }
        }catch(Exception e){
                out.println(e.getMessage());
 }
 try{
  sqlbean.close();
  rs=null;//let it null
  if(rs!=null)
   rs.close(); // if no this ,have exception
 }catch(SQLException e){
                out.println(e.getMessage());
 }
%>