public List queryForPage( ) throws SQLException{
    //查询数据库,得到记录总数
int count = (Integer)dao.queryForObject(this.getSql_count_id(), this);
this.setRowCount( count);
//计算总页数
this.jsPageCount();
//分页查询,得到list数据
return dao.queryForList(this.getSql_id(), this,(this.getPageNo()-1)*this.getPageSize(),this.getPageSize());
}
对应的SQL ID
this.sql_count_id = "queryCompanyCount";
this.sql_id = "queryCompany";
这里的queryCompanyCount与queryCompany在xml文件里进行了配置。
现在可以对表中的所有数据进行分页处理了,但没有思路将查询后的结果集进行分页处理,主要是参数不知道如何传递到配置文件的sql中。
请大家给些思路,或是发源码,请尽量详细一些。
补充:这里的分页我是自行写的标签。