Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Get row count from ResultSet object

843854Jan 5 2003 — edited Mar 16 2007
Hi,

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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 13 2007
Added on Jan 5 2003
11 comments
5,373 views