开发者

Refreshing data in a java.sql.ResultSet

开发者 https://www.devze.com 2022-12-27 16:05 出处:网络
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开发者_Go百科 the database?

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开发者_Go百科 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号