Why am I getting ResultSet is closed error when I never closed any(当我从未关闭任何内容时,为什么会收到 ResultSet is closed 错误)
问题描述
我的代码中有这个错误,并且已经彻底检查和编辑它,但我仍然遇到同样的问题.我还使用了多个 resultSet 和 Statements 但发生了同样的错误.以下是我得到的错误:
I have this error in my code and have checked and edited it thoroughly, yet I still get same issue. I also use multiple resultSet and Statements yet same error occurs. Below is the error I get:
"Database Connected with Current Date 20130221
java.sql.SQLException: ResultSet is closed
at sun.jdbc.odbc.JdbcOdbcResultSet.checkOpen(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcResultSet.next(Unknown Source)
at UNSUB.main(UNSUB.java:78)"
Press any key to continue . . .
请问可能是什么原因?我现在不知道有什么解决办法.
Please What could be the reason? I have no idea on any solution now.
推荐答案
异常,java.sql.SQLException: ResultSet is closed表示你的代码要么已经关闭了结果集对象您正在使用,或者更有可能,您的代码已经重新执行或关闭了以下语句产生了结果集.根据 JDBC 规范,这些操作中的任何一个都将关闭任何语句的结果集.
The exception, java.sql.SQLException: ResultSet is closed means that your code has either already closed the result set object
you're using, or more likely, that your code has either re-executed or closed the statement that
produced the result set. By JDBC specs, either of those actions will close any
result set from the statement.
这篇关于当我从未关闭任何内容时,为什么会收到 ResultSet is closed 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:当我从未关闭任何内容时,为什么会收到 ResultSet is closed 错误
基础教程推荐
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- RabbitMQ:消息保持“未确认"; 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- Struts2 URL 无法访问 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
- 使用堆栈算法进行括号/括号匹配 2022-01-01
