分页技术有三种,一种是用sql语句 ,但速度慢不过容易理解,第二种是存储过程来做,速度快,第三种是用分页的插件来做
下面的是第一种方法,可用来参考:pageRow:当前的行数,pageNum当前的行数的页数
public List<Topicsinfo>cutPage(String pageRow,String mid,String pageNum)
{
String sql="select top "+pageRow+" * from topicsinfo where modid="+mid+" and topid not in(select top "
+(Integer.parseInt(pageNum)-1)*Integer.parseInt(pageRow)+" topid from topicsinfo where modid="+mid+")";
return RunSeal.query(Topicsinfo.class, sql);
}