Hi all,
I am using ResultSet to fetch the returned records from the database. How can I get the number of rows directly?
I have used the following
Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY); //for scrollable result set.
rs=stmt.executeQuery("SELECT * FROM tab");
int k=rs.getFetchSize();
But it is not working. I am aware of some methods to find the rows fetched like keeping count and travesing rs using rs.next() or quering to database using Count key
word in the query to get the records.
But I want to get the size directly. Any help on this issue would be appreciated.
Regards,
Kiran.