On 28-11-2021 12:22, Dmitry Yemanov wrote:
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?
The intent of the method is to report the position of the current row.
The example it is abused by some to get the total size was just an
illustration of why people would expect a value after requesting the
last row. But the same would be a problem if people went to last,
scrolled around and then want to know the current row position.
I don't think a solution would necessitate a protocol change. For
example, a statement info request item that reports the current row
position on the server could be an option as well for me. Then I can
just request it if and when I do need to know the row position if I'm in
an indeterminate row position.
That said, if this isn't an option, I can simply make it throw an
exception, return -1, or something similar, and accept the violation of
the JDBC spec. If people then really need it, I could offer them a
fallback option to use the existing 'cache result set entirely in
memory' form of scrollable result sets (e.g. through a connection property).
Mark
--
Mark Rotteveel
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel