When I execute the following code:
I get the following printout:
Apr 15 22:50:19: dbUtils::dbResultSet2Subscription: rs= com.mysql.jdbc.Resul
Apr 15 22:50:19: rs is NOT before first
Apr 15 22:50:19: dbUtils::dbResultSet2Subscription: setting new subscription
Apr 15 22:50:19: dbUtils::dbResultSet2Subscription: Illegal operation on emp
ty result set.
So, rs is not null, is not before first, but when I go to get the columns, it throws that exception.
BTW, in this case, the result set is empty.
Therefore, in this function, beforeFirst could return false because a) there are no rows, or b) because it is positioned on the first row. In the latter case, getNext() returns false if there is only one row.
I don't know what would happen if you got a false beforeFirst, because it was empty, but then set it to beforeFirst to check getNext.
Anyway, I think that rs not having isEmpty() and rowCount() methods is a big deficiency. I kludged up a rowCount method as described above, and I actually used that, but the key to it was going to getLast().