you have deleted,updated or inserted rows.
You can do something like this
Using SQL Query:
Using JDBC Scrollable ResultSet: Can be very time counsuming if the resultset is big
You can altso use a cached rowset.
// Hope this helps
[ November 08, 2003: Message edited by: Mathias Nilsson ]
Hope I am not asking something new... :roll:
It definitely adds more overhead because you would basically be doing the query twice. I think the point people are trying to make is that the count(*) query is more efficient if you only need the number of rows. If you need any other data, you should stick with one query.
Originally posted by Jim Yingst:
I think that ResultSet is designed so that it's possible for an implementation to start returning rows as soon as it finds them, even though the query is still running on the server. So at the time you first start processing a ResultSet, the information about how many rows there will be total is not necessarily available - and if you asked for it, you would force the system to block until all the rows had been returned, which could be rather inefficient. Instead JDBC is set up so that if you really want the row count right away, you need to write a query that returns the row count, specifically.
But Jim it would depend on the vendor implementation of the same right ? Or is it that the latest spec enforces this implementation ?