当前位置: 技术问答>java相关
用尽的Resultset?
来源: 互联网 发布时间:2015-02-16
本文导语: 在运行时,有时会出现“用尽的Resultset”的错误,错误提示: javax.servlet.ServletException: 用尽的 Resultset at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459) at _0002fcauseupdate_0002ejspcauseupdate_jsp_0._jspSer...
在运行时,有时会出现“用尽的Resultset”的错误,错误提示:
javax.servlet.ServletException: 用尽的 Resultset
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459)
at _0002fcauseupdate_0002ejspcauseupdate_jsp_0._jspService(_0002fcauseupdate_0002ejspcauseupdate_jsp_0.java:361)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)
请高手帮忙参考一下,这是什么情况引起的?
急用!!!
javax.servlet.ServletException: 用尽的 Resultset
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459)
at _0002fcauseupdate_0002ejspcauseupdate_jsp_0._jspService(_0002fcauseupdate_0002ejspcauseupdate_jsp_0.java:361)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)
请高手帮忙参考一下,这是什么情况引起的?
急用!!!
|
原因可能有:
1。同一个statement进行了不止一次的数据库操作,包括update,select,delete,insert,
而同时又有此statement打开的resultset跨越了不止一个上述操作
2。反复取字段的值,毫无规律可言,就可能有这个错误
1。同一个statement进行了不止一次的数据库操作,包括update,select,delete,insert,
而同时又有此statement打开的resultset跨越了不止一个上述操作
2。反复取字段的值,毫无规律可言,就可能有这个错误
|
是否是已经到了记录末尾你还进行取值?
用Result.next()方法判断返回值是否为true?
用Result.next()方法判断返回值是否为true?
|
ResultSet rs = stmt.executeQuery(sql);
然后要判断rs是否为null
然后要判断rs是否为null
|
你先用try{}catch(Expection e){out.print(e);}捕捉一下错误原因看看。
|
有没有调用rs.close() 方法啊。