The implementation in FBCallableStatement.getXXX(String) identifies the index of the result set column using ResultSet.findColumn(String), and then calls the equivalent FBCallableStatement.getXXX(int) method. The problem is that getXXX(int) expects the registered OUT parameter index and not the result set index, and will remap columns.
If the index was mapped as an OUT parameter which corresponds to a different result set column, it can return the value of that different column. In theory, the implementation can also throw an exception with message "Specified parameter does not exist", though the current implementation has that option disabled.
This fix should be backported to Jaybird 4.0.10 and 5.0.3 as well.
The implementation in
FBCallableStatement.getXXX(String)identifies the index of the result set column usingResultSet.findColumn(String), and then calls the equivalentFBCallableStatement.getXXX(int)method. The problem is thatgetXXX(int)expects the registered OUT parameter index and not the result set index, and will remap columns.If the index was mapped as an OUT parameter which corresponds to a different result set column, it can return the value of that different column. In theory, the implementation can also throw an exception with message "Specified parameter does not exist", though the current implementation has that option disabled.
This fix should be backported to Jaybird 4.0.10 and 5.0.3 as well.