IBM Support

Java Toolbox JDBC ResultSet.getRow() sometimes return 0?

Question & Answer


Question

Why does ResultSet.getRow() sometimes return 0?

Answer

The getRow() returns the current row number within the ResultSet as an int. Previous to Modification 5 (Version 5 Release 2 or JTOpen version 3.x), the Toolbox JDBC driver attempted to keep track of this row number internally by starting at 0 and incrementing with each cursor position change. Depending on the cursor positioning methods used, the Toolbox JDBC driver might lose track of the row number and report it as 0. For example, if your program called last(), afterLast(), or absolute() with a negative value, the Toolbox JDBC driver could no longer compute the row number (since the total number of rows in a result set was not always known).
In Modification 5 (Version 5 Release 2 or JTOpen version 3.x), getRow() accurately returns the correct row number in all cases.

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Component":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Product Synonym

IBM i

Document Information

Modified date:
17 March 2020

UID

ibm11118037