請教高手sql錯誤:javax.servlet.ServletException: 用盡的 Resultset

yekong發表於2006-04-24
javax.servlet.ServletException: 用盡的 Resultset
這個錯誤老是出現。哪位能給我說下是什麼原因啊。
<%@ page contentType="text/html;charset=gb2312" %>
<%@ page language="java" import="java.sql.*" %>
<html>
<head>
<title>新聞</title>
</head>
<body>
<% Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url="jdbc:oracle:thin:@192.168.0.28:1521:oe";
//orcl為你的資料庫的SID
String user="bab";
String password="bab";
Connection conn= DriverManager.getConnection(url,user,password);
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
%>

<table>
<%
ResultSet rs1 = stmt.executeQuery("select * from TB_NEWS where NEWSID = '688'" );
%>
<tr>
<td height=20 align=center><b><%=rs1.getString("TITLE")%></b></td>
</tr>
<tr>
<td valign=top>
<p><%=rs1.getString("CONTENT")%></p></td>
</tr>
<%
rs1.close();
stmt.close();
conn.close();
%>
</table>

</body>
</html>

相關文章