28.11.2021 14:02, Mark Rotteveel wrote:

Is there a way to determine at which row the cursor is currently positioned? JDBC has the ResultSet.getRow()[1] method which is documented as: "Retrieves the current row number. The first row is number 1, the second number 2, and so on."

This is not problematic when using first, next, prior, relative or absolute, but once you do fetch_last, you don't know the row number until you do a first or absolute.

The usefulness of this method is limited, but sometimes it is abused by people wanting to know how many rows there are in a result set (by requesting the last row), and if I can't fulfill this requirement, I need to at least document this.

We don't have anything like this. Theoretically, we could extend IRecordSet with something similar (although it would also require a protocol change), but the question is whether it's really needed. Personally, I don't see it useful per se. If users want to know a number of rows, then perhaps an explicit getRowCount() method would be more useful (*). But AFAIU the Java API does not mention it.

(*) not applicable to uni-directional cursors?


Dmitry


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to