且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

ResultSet关闭后不允许操作

更新时间:2022-06-24 07:46:22

很难确定你发布的代码,但我怀疑 ResultSet 是无意中关闭(或 stm 正在重复使用) 正文内部循环 。这将在下一次迭代开始时触发异常。

It's hard to be sure just from the code you've posted, but I suspect that the ResultSet is inadvertently getting closed (or stm is getting reused) inside the body of the while loop. This would trigger the exception at the start of the following iteration.

此外,您需要确保应用程序中没有其他线程可能使用相同的线程数据库连接或 stm 对象。

Additionally, you need to make sure there are no other threads in your application that could potentially be using the same DB connection or stm object.