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>
|
|