int count = 0;
while (rs.next) {
    count++;
}
return count;

解决方案 »

  1.   

    String sqlStr = select count(*) from (select * from quhao where qh = "010");
    这样就可以了! :P
      

  2.   

    public int getRows(String sql) { //add by tlx in 20030917
    int rows = 0;
    try {
    ResultSet rss = stmt.executeQuery(sql);
    while (rss.next())
    rows++;
    rss.close();
    return rows;
    } catch (Exception e) {
    System.out.println(e.getMessage());
    return 0;
    }
    }
      

  3.   

    last(); // 將rs指到最後             
    count1=rs.getRow();不過,樓上幾位的方法均可行。
      

  4.   


    1.select count(*)2.rs.last()
      rs.getRow()3.getFetchSize()