谢谢了 新手 求安慰啊
<%@ page language="java" import="java.util.*,java.sql.*" pageEncoding="gb2312"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'wel.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
欢迎你的登陆,这是一个追求快乐的世界<%=request.getParameter("user") %> <br>
<a href="login.jsp">重新登陆</a>
<hr>
<h1>用户信心列表</h1>
<%
int pageSize=3;//每页显示多少记录
int pageNow=1;//现在显示多少记录
int pageCount=0;//一共有多少页
int rowCount=0;//一共有多少记录
//到数据库去验证 加载驱动
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
//得到连接
Connection ct=DriverManager.getConnection("jdbc:sqlserver://localhost:1433;Databasename=spdb", "sa", "hello");
//创建statement
Statement sm=ct.createStatement();
//查询语句
ResultSet rs=sm.executeQuery("select count(*) from users " );
if (rs.next())
{rowCount=rs.getInt(1);}
//计算pageCount
if(rowCount%pageSize==0){
pageCount=rowCount/pageSize;
}else{
pageCount=rowCount/pageSize+1;
}
// 查询出需要的数据
rs=sm.executeQuery("select top"+pageSize+" * from users where userId not in(select top "+pageSize*(pageNow-1)+"userId from users)");
//显示
%>
<table border ="1">
<tr><td>用户Id</td><td>用户账号</td><td>用户密码</td><td>用户手机号</td><td>用户级别</td></tr>
<%
while (rs.next()){
%>
<tr><td><%=rs.getInt(1)%></td><td><%=rs.getString(2) %></td><td><%=rs.getString(3) %></td><td><%=rs.getString(4) %> </td><td><%=rs.getInt(5)%></td></tr>
<%
}
&nbs