must be caught or declared to be thrown
写一个try catch

解决方案 »

  1.   

    这样写
    void List(Connection conn ,String father) throw java.sql.SQLException
    {
    sql_Category="select * from message_classify where father='"+father+"' order by cid";
    stmt=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    rs=stmt.executeQuery(sql_Category);
    sb.append(sql_Category.toString());
    }
      

  2.   

    ps : 少打了个s,应该是 throws java.sql.SQLException
      

  3.   

    就是没有对SQLException进行捕捉。
      

  4.   

    所有可能出错的代码最好都加上TRY
    后面写上相应的错误处理THROW ~~~~~~~~~~~~~~~~