数据库显示图片的问题

08-08-03 tomcatlin
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="com.core.ConnDB"%>

<%

<%

ConnDB conn=new ConnDB();
ResultSet rs=conn.executeQuery("select * from pic ");
%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="CSS/style.css" rel="stylesheet">
</head>

<body>


<%
int ID=0;
String url="";
try{
while(rs.next()){
ID=rs.getInt("id");
url=rs.getString("url");

}

}catch(Exception e){
System.out.println(e.getMessage());
}
%>
<img src="<%=url%>" width="800" height="600">
<a href="http://tomcatlin.gicp.net:8080/myweb/xiangce.jsp?">下一页</a>

</body>
</html>

问题:我想点击下一张时显示id=2所对应url的图片,继续点显示第3,4.。。。。。点击上一张同样显示。请各位老师帮忙

banq
2008-08-04 10:04
将ID作为参数传递; id=request.getParameter("Id");