我在一个页面里添加了个链接到另一个页面,用来显示数据库里某个商品条目的详细信息。运行后提示有[Microsoft][SQLServer 2000 Driver for JDBC]Invalid operation for the current cursor position.错误,这是为什么?我应该怎么改?
我的程序如下:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id="databean" scope="session" class="com.conndb"/>
<jsp:useBean id="list" class="com.WaresList" scope="session" />
<jsp:useBean id="pagebean" scope="session" class="com.pagebean"/>
<html>
<head>
<title>商品详细信息</title>
<style type="text/css">
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>
<script language="javascript">
</script>
<body background="D:\Tomcat\Tomcat 5.0\webapps\ROOT\jing\picture\back2.bmp">
<div align="center" class="b9b">商品详细信息
<p>
<form action="shopcart.jsp" method="post" name="form1">
<%
String Id=request.getParameter("Id");
ResultSet rs=null;
String sql="SELECT * FROM wares where Id='"+Id+"'";
databean.getConnection();
rs=databean.executeQuery(sql); //执行sql语句,使用了javabean conndb中的executeQuery
rs.next();
%>
<input type=hidden name="id" value="<%=rs.getString("Id")%>" >
<table width="300" border="1" cellspacing="1" cellpadding="1" bordercolordark="#6699ff" bordercolorlight="#FFFFFF">
<tr>
<th colspan="2" scope="col"><img src="<%= rs.getString("BigImg") %>"></th>
</tr>
<tr>
<th width="65" scope="row">商品名称</th>
<th width="222" scope="row"><%=rs.getString("Name") %></th>
</tr>
<tr>
<th scope="row">所属种类</th>
<th scope="row"><%=rs.getString("Sort")%></th>
</tr>
<tr>
<th scope="row">市场价</th>
<th scope="row"><%= rs.getString("MarketPrice") %></th>
</tr>
<tr>
<th scope="row">当前价格</th>
<th scope="row"><%=rs.getString("Price") %></th>
</tr>
<tr>
<th scope="row">商品介绍</th>
<th scope="row"><%=rs.getString("Description") %></th>
</tr>
</table>
<td width=40 height=30> </td>
<tr><td> </td>
<p>
</form>
</div>
</body>
</html>