java.sql.SQLException:用尽的结果集 [英] java.sql.SQLException: Exhausted Resultset

查看:36
本文介绍了java.sql.SQLException:用尽的结果集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I get the error java.sql.SQLException: Exhausted ResultSet to run a query against an Oracle database. The connection is via a connection pool defined in Websphere. The code executed is as follows:

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

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

I note that the resultset contains data (rs.next ())

谢谢

推荐答案

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

I've seen this error while trying to access a column value after processing the resultset.

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

希望对你有帮助:)

这篇关于java.sql.SQLException:用尽的结果集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆