java.sql.SQLException : Exhausted Resultset

标签 java sql oracle jdbc

我收到错误 java.sql.SQLException: Exhausted ResultSet 来对 Oracle 数据库运行查询。该连接是通过 Websphere 中定义的连接池进行的。执行的代码如下:

if (rs! = null) (
    while (rs.next ()) (
        count = rs.getInt (1);
    )
)

我注意到结果集中包含数据(rs.next ())

谢谢

最佳答案

我在处理结果集后尝试访问列值时看到此错误。

if (rs != null) {
  while (rs.next()) {
    count = rs.getInt(1);
  }
  count = rs.getInt(1); //this will throw Exhausted resultset
}

希望对你有帮助:)

关于java.sql.SQLException : Exhausted Resultset,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3502005/

相关文章:

.net - SQL Server 中的哈希码?

oracle - 如何使用 Oracle 的 sdo_distance

java - 在 Android EditText 中实时编辑时格式化数字 #,###

上传加密 PDF 文件时出现 java.lang.ClassNotFoundException

java - 将 Google Cloud SDK 2.X 与 Apache Beam 结合使用

sql - 在 Postgres 中整理的目的

sql - 如何使用 PHP 和 sqlsrv 驱动程序清理输入?

linux - 如何在 Bash 中将字符串转换为整数?

sql - 具有动态命名空间的 Oracle extractvalue

java - 如何将来自网站的 JSON 对象解析为 android 中的数组列表