Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Size of ResultSet...

 
Chris Cairns
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to create a utility method that will print out the records of any ResultSet. I'm trying to get the size of the ResultSet and to then print out the records in a for loop. I keep getting a SQL Exhaustion error in my current code, which I pasted below. Could someone please point me in the right direction.

[ April 25, 2003: Message edited by: Chris Cairns ]
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



This does not avoid any SQL exhaustion errors (what is that anyway?) because you're just creating another reference to the one and the same ResultSet object. What are you trying to achieve with this?




After executing this piece of code up to (X), you have ran through the ResultSet object referred by 'resultSet'. Right after (X) you are reading the value of the first column of the same ResultSet object you just iterated though. I doubt this is what you meant? How does that first column's value relate to 'recordSize'?
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chris,
According to the code you have posted, when your "while" loop terminates,

you have reached the end of your "ResultSet".
Therefore, this line of your code,

causes the "SQL Exhaustion" error you claim to be getting.
I will not even try to guess why you wrote the code this way, and therefore there isn't much more I can offer you (like suggesting a way to avoid getting the "SQL Exhaustion" error).
Hope this has helped you.
Good Luck,
Avi.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic