[thelist] i'm going bonkers

raditha dissanayake jabber at raditha.com
Tue May 25 09:37:28 CDT 2004


david.landy at somerfield.co.uk wrote:

>please help, i'm about to seek psychiatric advice...
>
>  
>
if your find a good head inspector let me know i want to give him a 
visit myself :-)

>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.
>  
>
Are you sure you are retrieving and checking the same result set? For 
example youa re testing rs.next() but you are retrieving 
rs.rs.getString() is this what you want?


>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
>  
>
You are testing the column count here and not the row count.

>metadata
>            String t = rs.rs.getString(i + 1);
>  
>
but you are retrieving from rs.rs

>        }
>  
>

-- 
Raditha Dissanayake.
---------------------------------------------
http://www.raditha.com/megaupload/upload.php
Sneak past the PHP file upload limits.



More information about the thelist mailing list