简体   繁体   中英

Refreshing data in a java.sql.ResultSet

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!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM