Get row count from ResultSet object
843854Jan 5 2003 — edited Mar 16 2007Hi,
I am making a query from a DB2 database with a stored procedure call. After making my query i would like to store my data into double scripted array. In order to initialize the dimensions of my array i need to get the row count and column count of my ResultSet. I can get the column count but the DB2 driver will not let me get the row count using the following method:
ResultSet.last();
int rowcount = ResultSet.getRow();
ResultSet.first();
I am assuming that this is the case because the DB2 drivers do not allow to scroll resultsets
another method i've seen used is simply
int rowcount = ResultSet.getFetchSize();
this does not work either
since I am using a stored procedure to query my database i cannot even use a select * from database_name.
does anyone have any suggestions to how i might be able to do this.
thanks in advance.