Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in SQL by (6.1k points)

I am getting the error java.sql.SQLException: Exhausted ResultSet to exeute a query against an Oracle database. The connection is via a connection pool defined in the Websphere. The code executed is below:

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

I can see here that the result set contains data (rs.next ())

1 Answer

0 votes
by (12.7k points)

I have noticed 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
}

Hope this helps !

Are you looking for a SQL Tutorial? Join the SQL Course offered by to gain more knowledge.

Related questions

0 votes
1 answer
0 votes
2 answers
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...