Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: java.sql.SQLException: Exhausted Resultset

Re: java.sql.SQLException: Exhausted Resultset

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: 26 May 2005 02:31:00 -0700
Message-ID: <1117099860.831351.35060@o13g2000cwo.googlegroups.com>

Sybrand Bakker wrote:
> On Wed, 25 May 2005 18:47:46 GMT, Alessandro Lagostena
> <alessandro.lagostena_at_tin.it> wrote:
>
> >Can this error depend from a bad status of the table ?
>
> No, in that case an ORA- error message would have been thrown
>
> >
> >I check on the alert log of oracle and not found any message
>
> Of course not, because nothing is wrong with the database. The problem
> is with 'scanning' 8 million records

I agree. There is nothing wrong with the database and scanning 8 million records maybe bad design... but the "Exhausted Resultset" error message in this instance is most likely not attributed to just scanning n number of records.

> >
> >Do someone have an idea ?
>
> Yes. Why is it that Java programmers live in the misconception they
> never ever make a mistake, that Java isn't memory hungry, and their
> programs never run out of memory?
> Why is it they invariably blame the database for their mistakes?
> Because they don't know anything about the database and treat it as a
> flat file system?
> Nagging questions with obvious answers.
>

This particular error message is thrown if you try to fetch from a resultset that did not return any rows. OP did not post the culprit code... so just going by the "Exhausted Resultset" error message, I don't think there are any memory issues here. Just bad programming perhaps... and the reason for that is that a resultset may or may not return any rows, a good programmer *will* check the resultset by using next() method *prior* to fetching from it e.g.

ResultSet rset = ....;
while (rset.next()) {

   // You ONLY get here if there are any rows }

Regards
/Rauf Received on Thu May 26 2005 - 04:31:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US