怎么样得到记录集中 的  记录条数。
   类似  count 的功能

解决方案 »

  1.   

    resultset.last();
    int c = resultset.getRow();
      

  2.   

    resultset.last();
    int c = resultset.getRow();
      

  3.   

    Result set type怎么设置???
      

  4.   

    resultset.last();
    我为什么不能用这个方法?
      提示javax.servlet.ServletException: Result set type is TYPE_FORWARD_ONLY
    错误!!!
      

  5.   

    各位说的都是唯一的办法,你应该建立语句的时候指定2个参数,否则无法调用last方法,无法滚动光标。 cnn.createStatement(int resultSetType, int resultSetConcurrency) ,第一个参数是指定光标是否可以滚动,第二个是是否记录更新敏感,你查一下文档吧。
      

  6.   

    PreparedStatement StatementselectRs = ConnselectRs.prepareStatement("SELECT * FROM dbo.selectINF where testType like '"+subject+"'    ");
    ResultSet selectRs = StatementselectRs.executeQuery();
     这样怎么改变结果集的类型?
      

  7.   

    sql=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
    这样就可以了
      

  8.   

    楼上的。。SQL是什么?
      是Statement类型的 变量?