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
}
希望对你有帮助:)