[thelist] i'm going bonkers

Ed McCarroll Ed at ComSimplicity.com
Tue May 25 10:57:31 CDT 2004


("bonkers"?  Isn't that a race track near New York City?)

Kidding aside, it might help if we could see more of the code, particularly
the SQL used to open the rs.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ed McCarroll                             http://www.ComSimplicity.com
(310) 838-4330                      PO Box 654, Culver City, CA 90232
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

> -----Original Message-----
> From: thelist-bounces at lists.evolt.org 
> [mailto:thelist-bounces at lists.evolt.org] On Behalf Of 
> david.landy at somerfield.co.uk
> Sent: Tuesday, May 25, 2004 7:58 AM
> To: thelist at lists.evolt.org
> Subject: [thelist] i'm going bonkers
> 
> 
> please help, i'm about to seek psychiatric advice...
> 
> has anyone seen anything like this? i'm trying to count the 
> rows in a java
> resultset. moving to the last record using last()and getting 
> the row number
> with getRow() returns 5. the trouble is there are really 19 
> rows in the
> resultset, and iterating through them reveals this.
> 
> the next() method is also incorrectly returning false after row 5, and
> isAfterLast gives a spurious true, as well.
> 
> bizarrely: 
> 
> <code>
>     while (true) {
>         rs.next();
>         for (int i = 0; i < md.getColumnCount(); i++) { //md 
> is resultset
> metadata
>             String t = rs.rs.getString(i + 1);
>         }
>         rows++;
>         out.println("rows:" + rows + "<br>");
>     }
> </code>
> 
> iterates correctly through all 19 rows in the resultset, and 
> bombs out on
> the 20th (non-existent) row -- the error is expected and caught.)
> 
> however:
> 
> <code>
>     while (true) {
>         rs.next();
>         String t = rs.rs.getString(1);
>         rows++;
>         out.println("rows:" + rows + "<br>");
>     }
> </code>
> 
> iterates only to row 5 and then bombs out.
> 
> ideas, anyone?
> 
> setup: apache/tomcat, winnt4, jdk 1.4.2
> 
> thanks in advance for any help/pointers.
> 
> david
> -- 
>  
> If you are not the intended recipient of this e-mail, please 
> preserve the
> confidentiality of it and advise the sender immediately of 
> any error in
> transmission. Any disclosure, copying, distribution or action 
> taken, or
> omitted to be taken, by an unauthorised recipient in reliance upon the
> contents of this e-mail is prohibited. Somerfield cannot 
> accept liability
> for any damage which you may sustain as a result of software 
> viruses so
> please carry out your own virus checks before opening an 
> attachment. In
> replying to this e-mail you are granting the right for that 
> reply to be
> forwarded to any other individual within the business and 
> also to be read by
> others. Any views expressed by an individual within this 
> message do not
> necessarily reflect the views of Somerfield.  Somerfield 
> reserves the right
> to intercept, monitor and record communications for lawful business
> purposes.
> -- 
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> 
> For unsubscribe and other options, including the Tip Harvester 
> and archives of thelist go to: http://lists.evolt.org 
> Workers of the Web, evolt ! 
> 



More information about the thelist mailing list