[thelist] i'm going bonkers

david.landy at somerfield.co.uk david.landy at somerfield.co.uk
Tue May 25 10:56:42 CDT 2004


Thanks for the extra pair of eyes... ;))

>Are you sure you are retrieving and checking the same result set? 
Yes, that was a typo, sorry. I thought I'd removed all rs.rs and replaced
them with rs for simplicity but I forgot one.

>You are testing the column count here and not the row count.
Yes, that's correct. I'm retrieving data from each column of the resultset,
and if any of them fail, I assume I've hit the bottom. Admittedly it's a bit
overkill to test EVERY column but read on...

The md.columnCount() is 8.

So if we do this in the loop:

<code>
        for (int i = 0; i < 2; i++) {
            String t = rs.getString(i + 1);
        }
</code>

...we get 19 rows. Good enough. 

But if we do:

<code>
        for (int i = 0; i < 1; i++) {
            String t = rs.getString(i + 1);
        }
</code>

It returns just 5 rows. 

Go figure!!

David

PS. The aggravating factor is that my workaround to this was to try to use a
stored query with parameters. But then the resultset turns out to be
*forward-only* regardless of what I tell it, and there is NO way of counting
the rows before getting their data. And once they've been counted, I can't
go back. ;( 

Feel like I've hit a wall on this one. Any help greatly appreciated.
-- 
 
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.


More information about the thelist mailing list