计算总页数方法:
第一种:
public int getTotalCount() {
Statement stmt = null; //提交SQL语句对象stmt
ResultSet rs = null; //保存结果对象rs
String strSql = null;
int count = 0; //初始化总记录数
try {
strSql = " select count(*) as sum from article "; 查询语句,(某张表的总记录数,count(*)函数得到)
stmt = conn.createStatement(rs.TYPE_SCROLL_INSENSITIVE, rs.CONCUR_READ_ONLY); //一个连接数据库活动
&nb