Thread: ResultSet size
View Single Post
  #6 (permalink)  
Old 04-25-2008, 02:42 PM
felixtfelix felixtfelix is offline
Member
 
Join Date: Dec 2007
Posts: 32
felixtfelix is on a distinguished road
Hi,
Otherwise you can use the following code, as i said in the earlier post rs.getRow() will give the no of the row. so you can make the resultset scrollable and use the following code.

Statement stmt = connection.createStatement(
ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR _READ_ONLY);

ResultSet resultSet = stmt.executeQuery("SELECT * FROM my_table");

resultSet.last();
int rowCount = resultSet.getRow();

Will it help.

Regards,
Felix T
Reply With Quote