public Page getStudentList(String page) {
ResultSet rst = null;
ArrayList list = new ArrayList();
int pageNum;
if (page == null || page.equals("")) pageNum = 1;
八年级上册英语el pageNum = Integer.parInt(page);
p.tRowsPerPage(6); //每页显示6行
String s1 = "lect top " + pageNum * p.getRowsPerPage() + " * from table where ...."; String s2 = "lect count(*) from table where ...";
pstmt = conn.prepareStatement(s2);
rst = uteQuery();
if (()) p.Int(1)); //取得一共的行数
pstmt = null;
rst = null;
七夕的英文pstmt = conn.prepareStatement(s1, ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
导游英语
rst = uteQuery();
int i = (pageNum - 1) * p.getRowsPerPage(); //
if (i != 0) rst.absolute(i);
while (()) {
...
list.add(...);
}
p.tCurPage(pageNum); //第几页
explicitlyp.tList(list); //list
p.tMaxPage(); //最大页数
return p;
}
特殊用法:
public Page archGroup(Group group, int pageSize) throws DaoException {denny
Page page = new Page();
try {
Session ssion = HibernateUtil.currentSession();
HibernateUtil.beginTransaction();
Example exampleGroup = ate(group);
exampleGroup.ignoreCa().enableLike(MatchMode.ANYWHERE);
//ludeZeroes();
Criteria criteria = ateCriteria(Group.class).add( exampleGroup).addOrder(Order.asc("groupCreateDate"));
List list = criteria.list();
page.tMaxRowCount(list.size());
//page.tRowsPerPage(2);
page.tMaxPage();
page.tFormName("groupInfoForm");
Debug.println("记录的总页数为:" + MaxPage());
//判断如果分页数大于最大页数,则将页数设置为第一页
if (pageSize > MaxPage() || pageSize < 0) {
Debug.println("警告:请求的分页数 " +
pageSize + " 大于该记录的总页数 " +
" 或者小于 0 ,请求的页数将置为 1 。");
pageSize = 1;
}
//设置当前页数
page.tCurPage(pageSize);
list = criteria.RowsPerPage())
工程队.tFirstResult((pageSize - 1) * RowsPerPage()) .list();
page.tList(list);
} catch (HibernateException ex) {
} finally {
HibernateUtil.cloSession();
}
farm什么意思
return page;
Page page = GroupList(1);
page.ContextPath() + "/group/EditGroup.jsp"); request.tAttribute("groupPageList",page);
religiousjsp页面用法:
hca<%
String strpage = Parameter("Page");
int PageNum;
if (strpage != null) {
PageNum = Integer.parInt(strpage);
}
el {
PageNum = 1;
terryworld}
Page pagelist = new Page();
pagelist = GroupLists(PageNum);
//request.tAttribute("gps", List());
List groupList = List();
%>
<%
for(int i=0;<groupList.size();i++){
Group group = ((i);
out.Name());
}
%>
//生成前台分页信息
<%
if (List() != null) {
out.print(pagelist.pageStr("\"viewGroups.jsp\""));
}
%>