溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

jsp分頁源程序

發(fā)布時間:2020-08-05 05:05:33 來源:ITPUB博客 閱讀:153 作者:johnhan2007 欄目:編程語言
jsp分頁源程序 ^_^ .......[@more@]

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

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


教師信息查詢





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

教師信息查詢
















<%
request.setCharacterEncoding("gb2312");
int nowPages;//當前頁
int pages;//請求頁數(shù)
int countPerPage = 10 ; //每頁顯示條數(shù)
int pageCount;//總頁數(shù)
int recordCount=tmessgeBean.getCounter("select count(*) from dysf_teacher ");

pageCount = (int)Math.ceil((recordCount + countPerPage-1) / countPerPage);//算出總頁數(shù)
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();
%>



返回首頁
教號 姓名 系別 專業(yè) 操作選項
<%= ID %>

<%= tname %>

<%= tdepartment %>

<%= tspecial %>
">刪除
共有<%= recordCount %>條記錄 當前<%= nowPages %>/<%= pageCount %>頁 
<% if(pageCount > 1){ %>
<% if(pages > 1){%>
首頁
<%}if(pages < pageCount){%>
">下一頁
<%}if(pages != 1){%>
">上一頁
<%}%>
">尾頁
<% } %>跳轉到




向AI問一下細節(jié)
推薦閱讀:
  1. jsp之分頁
  2. jsp分頁總結

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權內(nèi)容。

AI