我刚学jsp,不会做分页技术...下面是我的代码..
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*,java.io.*" errorPage="" %>
<jsp:useBean id="ku" scope="page" class="sqlku.sqlku"/>
<%request.setCharacterEncoding("gb2312");%>
<html>
<head>
<title></title>
<link href="../css.css" rel="stylesheet" type="text/css">
<%
String sql="select * from news order by id desc";
ResultSet rs=ku.executeQuery(sql);
%>
</head>
<body>
<table width="800" align="center" border="1" height="50" bordercolor="#9B9BC6">
<tr align="center">
<td>新闻管理</td>
</tr>
</table>
<br>
<table width="800" align="center" border="1" bordercolor="#9B9BC6">
<tr height="25" bgcolor="#9b9bc6" align="center">
<td width="50">新闻编号</td>
<td width="150">新闻分类</td>
<td width="200">新闻标题</td>
<td width="200">发布时间</td>
<td width="200">操作</td>
</tr>
<%
while(rs.next()){
%>
<tr align="center" height="25" onmouseover="this.style.backgroundColor='#adadd8'" onmouseout="this.style.backgroundColor='#BEBFD9'">
<td><%=rs.getString("id")%></td>
<td><a href="news_fl.jsp"><%=rs.getString("news_fl") %></a></td>
<td><%=rs.getString("news_bt")%></td>
<td><%=rs.getString("news_time") %></td>
<td><a href="news_tian.jsp">添加</a>
<a href="news_xiu.jsp?id=<%=rs.getString("id")%>">修改</a>
<a href="news_shan.jsp?id=<%=rs.getString("id")%>" onClick="return confirm('你确定删除!')">删除</a></td>
</tr>
<%
} %>
</table>
<table>
<tr>
<td>
</td>
</tr>
</table>
</body>
<%
rs.close();
ku.closeStmt();
ku.closeConn();
%>
</html>