int recoutCount = 0;
try{
rs.last();
recountCount= rs.getRow();
}
catch (SQLException e){
}
这里的rs必须是可以滚动的!

解决方案 »

  1.   

    很多办法:
    1.把SQL语句改成count()
    2.
    int rslength=0;
    while(rs.next)
    {
        rslength++;
    }
    3.
    int recoutCount = 0;
    if(rs.next)
    {
        rs.last();
        recountCount= rs.getRow();
    }
      

  2.   

    不知道count (*)好呢?
    还是
    int rslength=0;
    while(rs.next)
    {
        rslength++;
    }
    这种类型的好?
    从全局考虑。
      

  3.   

    如果只要取得记录数count (*)比较好用,节省资源
      

  4.   

    count(*) 可行,
    实现楼主提的问题,解决的办法很多