You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Matt Frantz <mh...@yahoo.com> on 2006/07/21 08:38:29 UTC

Embedded driver support for ResultSet.getRow

I am porting an application from PostgreSQL to Derby.  I use ResultSet.getRow()
to keep track of whether a particular row has been processed.  However, I get an
error like this:

The 'getRow()' method is only allowed on scroll cursors

It seems that even a forward iterator should be able to keep count of the rows,
so this method should be supported.  Am I mistaken about the semantics of this
method?  Is there another way to know which row I'm on without using scrolling
ResultSets, which (according to the docs) read the results into memory?

Regards,
Matt Frantz



Re: Embedded driver support for ResultSet.getRow

Posted by Andreas Korneliussen <An...@Sun.COM>.
Matt Frantz wrote:
> I am porting an application from PostgreSQL to Derby.  I use ResultSet.getRow()
> to keep track of whether a particular row has been processed.  However, I get an
> error like this:
> 
> The 'getRow()' method is only allowed on scroll cursors
> 

I could not find anything in JavaDoc for ResultSet.getRow() which 
indicates that getRow() should not be allowed on forward-only result 
sets. So this may be a bug in Derby.

> It seems that even a forward iterator should be able to keep count of the rows,
> so this method should be supported.  Am I mistaken about the semantics of this
> method?  Is there another way to know which row I'm on without using scrolling
> ResultSets, which (according to the docs) read the results into memory?
> 

The docs are out-of-date. I am not sure exactly which version, however 
at least since 10.1.2 scrollable resultsets will back the data to disk 
(to a temporary table) if the result set is huge.

Regards
Andreas

> Regards,
> Matt Frantz
> 
>