while(rs.next()){
       boolean sec=rs.getBoolean("sec"); }
     rs.close();这段代码要catch sql exception,如果是在jsp中不是必须的,在普通java程序中(包括servlet)要catch

解决方案 »

  1.   

    public boolean next()
                 throws SQLException
    try{
    while(rs.next()){
           boolean sec=rs.getBoolean("sec"); }
        rs.close();
    }catch(Exception e){}
      

  2.   

    天啊,我就是不想用try,catch,因为我觉得可以不用的.有知道的吗
      

  3.   

    这地方必须用try,我也遇到过,没找到别的办法
      

  4.   

    在你的
    public ResultSet getResult(String sSql,Connection conn)后面加上
    throws IOException
    试试
      

  5.   

    public boolean next()
                 throws SQLException
    不加try是不行的!!!!
      

  6.   

    但是我看很多JSP里都没加try 啊
      

  7.   

    jsp编译成类之前的过渡类里面也是要用try/catch/finally方式的,你没有了解其原理