tags:

views:

38

answers:

1

I have a java.sql.ResultSet object containg data from a query that was run.

How do I refresh the data in the ResultSet to reflect the current data in the database?

Thanks!

+2  A: 

The best answer is that you need to close the ResultSet and issue the query again, to get a new ResultSet. The slightly longer answer is that it's possible to set the transaction isolation level to let you see other transaction updates while iterating, but, that's not probably what you mean.

Sean Owen
+1 for hitting the point about the transaction isolation. That will be a very big driver of what is possible here.
Yishai