ResultSet rs = ....
rs.last();
rs.getRow();

解决方案 »

  1.   

    /**
         * Retrieves the current row number.  The first row is number 1, the
         * second number 2, and so on.  
         *
         * @return the current row number; <code>0</code> if there is no current row
         * @exception SQLException if a database access error occurs
         * @since 1.2
         */
    第一行是 1,第二行是 2 ... 所以rs.last.然后getrow就是最后一行.也就是行数了 :)
      

  2.   

    做一次循环了~~ResultSet 似乎没有rowCount的函数
      

  3.   

    呵呵,自己写个库增强ResultSet的功能