当前位置: 技术问答>java相关
关于数据库分页
来源: 互联网 发布时间:2015-07-18
本文导语: 代码: try{ rsCount=statement.executeQuery(SQLStrCount); rsCount.next(); intRowCount=rsCount.getInt(1); rsCount.close(); intPageCount = (intRowCount+intPageSize-1) / intPageSize;//统计总页数 }catch(Exception e){} 分页程序中的intRowCount=rsCount.getInt(1...
代码:
try{
rsCount=statement.executeQuery(SQLStrCount);
rsCount.next();
intRowCount=rsCount.getInt(1);
rsCount.close();
intPageCount = (intRowCount+intPageSize-1) / intPageSize;//统计总页数
}catch(Exception e){}
分页程序中的intRowCount=rsCount.getInt(1);不是代表取第一栏为int的表格的值吗?
为什么能够统计总行数?
try{
rsCount=statement.executeQuery(SQLStrCount);
rsCount.next();
intRowCount=rsCount.getInt(1);
rsCount.close();
intPageCount = (intRowCount+intPageSize-1) / intPageSize;//统计总页数
}catch(Exception e){}
分页程序中的intRowCount=rsCount.getInt(1);不是代表取第一栏为int的表格的值吗?
为什么能够统计总行数?
|
因为他的SQLStrCount语句是类似 select count(*) as num from.......的语句吧............