资源简介
JSP实现分页显示数据库中的数据
JSP实现分页显示数据库中的数据
JSP实现分页显示数据库中的数据
JSP实现分页显示数据库中的数据

代码片段和文件信息
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;
import java.io.*;
public final class index_jsp extends org.apache.jasper.runtime.HttpJspbase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.Vector _jspx_dependants;
private org.apache.jasper.runtime.ResourceInjector _jspx_resourceInjector;
public object getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request HttpServletResponse response)
throws java.io.IOException ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType(“text/html;charset=UTF-8“);
pageContext = _jspxFactory.getPageContext(this request response
null true 8192 true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
_jspx_resourceInjector = (org.apache.jasper.runtime.ResourceInjector) application.getAttribute(“com.sun.appserv.jsp.resource.injector“);
out.write(“\n“);
out.write(“\n“);
out.write(“\n“);
mysql.DBManager db = null;
synchronized (_jspx_page_context) {
db = (mysql.DBManager) _jspx_page_context.getAttribute(“db“ PageContext.PAGE_SCOPE);
if (db == null){
db = new mysql.DBManager();
_jspx_page_context.setAttribute(“db“ db PageContext.PAGE_SCOPE);
}
}
out.write(‘\n‘);
int pagesize = 5; //每页显示的数据量
StringBuffer userInfo = new StringBuffer();
StringBuffer pageInfo = new StringBuffer();
ResultSet rs = db.getResult(“select * from student_info“);
String paramPage = request.getParameter(“page“);
int currentPage = 1;
try{
currentPage = Integer.parseInt(paramPage);
}catch(Exception e){
currentPage = 1;
}
rs.last();
int totaluser = rs.getRow();
int pagecount = (int)Math.ceil((float)totaluser/(float)pagesize);
int i = 1;
rs.absolute((currentPage-1) * pagesize + 1);
while(i<=pagesize && !rs.isAfterLast()){
userInfo.append(“\n“);
userInfo.append(““ + ((currentPage - 1) * pagesize + i) + “ “);
userInfo.append(““ + rs.getString(1) + “ “);
userInfo.append(““ + rs.getString(
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6614 2009-07-14 08:32 分页显示\build\generated\classes\org\apache\jsp\index_jsp.class
文件 133 2009-07-14 08:32 分页显示\build\generated\src\org\apache\jsp\index_jsp.class.smap
文件 5733 2009-07-14 08:32 分页显示\build\generated\src\org\apache\jsp\index_jsp.java
文件 505 2009-07-14 08:32 分页显示\build\web\gfv3.dpf
文件 2890 2009-07-14 08:32 分页显示\build\web\index.jsp
文件 25 2009-07-13 20:18 分页显示\build\web\meta-INF\MANIFEST.MF
文件 0 2009-07-13 20:18 分页显示\build\web\WEB-INF\classes\.netbeans_automatic_build
文件 2239 2009-07-14 08:09 分页显示\build\web\WEB-INF\classes\mysql\DBManager.class
文件 287022 2009-07-13 20:18 分页显示\build\web\WEB-INF\msbase.jar
文件 67115 2009-07-13 20:18 分页显示\build\web\WEB-INF\mssqlserver.jar
文件 59074 2009-07-13 20:18 分页显示\build\web\WEB-INF\msutil.jar
文件 409322 2009-07-13 20:18 分页显示\build\web\WEB-INF\sqljdbc.jar
文件 505 2009-07-13 20:18 分页显示\build\web\WEB-INF\sun-web.xml
文件 490 2009-07-13 20:18 分页显示\build\web\WEB-INF\web.xml
文件 3505 2009-07-13 19:40 分页显示\build.xml
文件 830405 2009-07-14 00:09 分页显示\dist\____.war
文件 3676 2009-07-14 00:00 分页显示\nbproject\ant-deploy.xml
文件 45890 2009-07-14 08:08 分页显示\nbproject\build-impl.xml
文件 464 2009-07-14 08:08 分页显示\nbproject\genfiles.properties
文件 1856 2009-07-14 08:08 分页显示\nbproject\private\private.properties
文件 211 2009-07-22 18:21 分页显示\nbproject\private\private.xml
文件 2140 2009-07-14 08:08 分页显示\nbproject\project.properties
文件 692 2009-07-13 19:40 分页显示\nbproject\project.xml
文件 25 2009-07-13 19:40 分页显示\src\conf\MANIFEST.MF
文件 1398 2009-07-13 20:17 分页显示\src\java\mysql\DBManager.java
文件 2890 2009-07-14 08:32 分页显示\web\index.jsp
文件 287022 2004-04-21 16:22 分页显示\web\WEB-INF\msbase.jar
文件 67115 2004-04-21 16:22 分页显示\web\WEB-INF\mssqlserver.jar
文件 59074 2004-04-21 16:22 分页显示\web\WEB-INF\msutil.jar
文件 409322 2008-07-18 08:29 分页显示\web\WEB-INF\sqljdbc.jar
............此处省略32个文件信息
相关资源
-
JSP企业人事管理系统设计(源代码+论
-
实现一个图书管理系统
-
JAVA JSP公司财务管理系统 源代码 论文
-
JSP+MYSQL旅行社管理信息系统
-
JSP,SQL,MVC的选课系统
-
基于JSP的学生宿舍管理系统(源码 数
-
JSP选课管理系统
-
mysql jsp网站源码下载
-
JSP做的化妆品商城
-
Jsp购物车实例
-
基于JSP的校友信息管理系统(添加数
-
基于jsp的bbs论坛 非常详细
-
jsp oracle通讯录
-
JSP学生信息管理系统 Mysql数据库
-
使用jsp servlet做的投票系统
-
JSP登陆验证 实现JSP用户名 密码 验
-
jsp基于servlet 图书馆管理系统
-
jsp学生成绩管理系统.rar
-
在线考试系统源代码(jsp)
-
超级好的纯jsp写的聊天室
-
JSP 网上购物网页项目
-
JSP+mysql新闻发布系统.rar
-
jsp 学生信息管理系统设计与实现
-
jsp与SQL Server数据库实现的客户注册登
-
简易教学管理系统(jsp spring struts h
-
学生信息管理系统 JSP MySQL
-
jsp ajax 三级联动菜单
-
jsp新闻公告与最新消息系统(具备添
-
JSP课程设计-留言本 jsp mysql tomcat实现
-
jsp 做的 班级管理网站
评论
共有 条评论