如何获得ResultSet记录集中记录的条数?
如何获得ResultSet记录集中记录的条数?
是有一个方法吧?
请高手指教!
[解决办法]
rs.last();
int r = rs.getRow();
[解决办法]
select count(*) from table
rs.next();
rs.getInt(1);
[解决办法]
int count = 0;
while(rs.next())
{
count ++;
}
[解决办法]
方法1:
int a=rs.getRow();
方法2:
int a = 0;
while(rs.next())
{
a ++;
}