jsp分页源程序

jsp分页源程序 ^_^ .......[@more@]

<%@ page contentType="text/html; charset=gb2312" language="java"%>

创新互联是网站建设技术企业,为成都企业提供专业的成都做网站、成都网站建设,网站设计,网站制作,网站改版等技术服务。拥有10余年丰富建站经验和众多成功案例,为您定制适合企业的网站。10余年品质,值得信赖!

<%@ page import = "java.util.*"%>
<%@ page import = "java.io.*"%>
<%@ page import = "java.sql.*"%>


教师信息查询





<%session.getAttribute("a_name");%>

教师信息查询
















<%
request.setCharacterEncoding("gb2312");
int nowPages;//当前页
int pages;//请求页数
int countPerPage = 10 ; //每页显示条数
int pageCount;//总页数
int recordCount=tmessgeBean.getCounter("select count(*) from dysf_teacher ");

pageCount = (int)Math.ceil((recordCount + countPerPage-1) / countPerPage);//算出总页数
if(request.getParameter("pages") == null){

pages = 1;
}else{
pages = new Integer(request.getParameter("pages")).intValue();
}


if(pages > pageCount){
nowPages = 1;
}else{
nowPages = pages;
}

ResultSet rs = tmessgeBean.executeQuery("Select top "+ countPerPage +" * from dysf_teacher where id not in (select top "+ (nowPages-1)*countPerPage +" id from dysf_teacher order by id desc) order by id desc ");
while(rs.next()){
String ID = rs.getString("id");
String tdepartment = rs.getString("department");
String tspecial = rs.getString("special");
String tname = rs.getString("name");
%>








<%
}
rs.close();
%>



返回首页
教号 姓名 系别 专业 操作选项
<%= ID %>

<%= tname %>

<%= tdepartment %>

<%= tspecial %>
">删除
共有<%= recordCount %>条记录 当前<%= nowPages %>/<%= pageCount %>页 
<% if(pageCount > 1){ %>
<% if(pages > 1){%>
首页
<%}if(pages < pageCount){%>
">下一页
<%}if(pages != 1){%>
">上一页
<%}%>
">尾页
<% } %>跳转到





网站名称:jsp分页源程序
文章路径:http://pwwzsj.com/article/ggdcch.html