I don't remember it being like this when using ResultSets in the past,
but when using j2sdk1.4.2_03 on Windows NT, it seems that I can only
call a rs.getXXX() method once per iteration. For example, if I do:
while (rs.next()) {
String s = rs.getString("Field1");
if (s != null && s.length() > 0)
System.out.println(s);
}
then everything works okay. But if I do:
while (rs.next()) {
if (rs.getString("Field1") != null &&
((String)rs.getString("Field1")).length() > 0 )
System.out.println(rs.getString("Field1"));
then it either returns an empty ResultSet or only 1 row before
throwing an exception. Did anyone else run into this problem?
Thanks
kaeli - 16 Jan 2004 19:38 GMT
> I don't remember it being like this when using ResultSets in the past,
> but when using j2sdk1.4.2_03 on Windows NT, it seems that I can only
> call a rs.getXXX() method once per iteration. For example, if I do:
The specs/docs specifically state that you should NOT call getXXX more
than once per iteration. Don't. Put it in a variable then do what you
need to do with it. Less overhead, too.

Signature
--
~kaeli~
A midget fortune teller who escapes from prison is a small
medium at large.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace