You were pretty close, the right solution:
Row r = rs.one(); if (r != null) r.getString("some_column");
The driver will always return a result set, regardless of whether there were any returned results. The documentation for one () states that if no rows were returned, rs.one () returns null.
You can also use getAvailableWithoutFetching () , which returns the number of rows in the result set without getting more rows. Since pageSize must be> = 1, you can be sure that if there is at least 1 row, it will always return a value greater than 0.
Andy tolbert
source share