db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <Knut.Hat...@Sun.COM>
Subject Re: Can an embedded Derby connection support multiple simultaneous result sets?
Date Tue, 03 Feb 2009 10:48:58 GMT
>>>"John T. Dow" <john@johntdow.com> writes:
>> For example, after calling rs2.next(), rs1.getRow() returns 0. 
>> However, the resultset is positioned properly because
>> rs1.getString("colname") returns the correct value.

Looks like I missed that last sentence when I answered your mail the
first time. I still think that rs1 is not positioned on a row, and
that's why rs1.getRow() returns null. The difference between getRow()
and getString() is that the ResultSet object has a copy of the current
row from which getString() fetches the string value, and it's not
affected by the fact that the underlying cursor has lost its
position. The row number, on the other hand, is not cached in the
ResultSet, so getRow() always fetches the row number from the cursor and
therefore detects that there's no current row.

Knut Anders

View raw message