如果表内容更改则更新 RowSet?

发布于 2024-08-21 19:42:43 字数 217 浏览 4 评论 0原文

如果表内容发生更改(例如另一个应用程序修改它),是否可以更新/刷新 RowSet?这样我就“始终”拥有该表的最新版本。

我研究了 RowSetListener,但这些事件似乎只有在我直接修改 RowSet 时才会被调用。知道发生了变化就足够了,我知道......变化很大:)

请分享您的想法!提前致谢! 丹尼尔

Is it possible to update/refresh a RowSet's in case the table content is changed (for e.g. another application modifies it)? So this way I 'always' have an up-to-date version of the table.

I looked into RowSetListener, but these events seem to get invoked only if I make modifications to the RowSet directly. It would be enough to know that there was a change, I know... that's a lot :)

Please share your thoughts! Thanks in advance!
Daniel

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

嗼ふ静 2024-08-28 19:42:43

不,对于大多数传统的 RDBMS 来说没有任何办法。只是因为 http://en.wikipedia.org/wiki/ACID#Isolation

No, there are no any way, for most traditional RDBMS. Just because of http://en.wikipedia.org/wiki/ACID#Isolation

甜尕妞 2024-08-28 19:42:43

是的,可以刷新 RowSet。只需再次调用其“execute()”方法即可。

根据文档 :

如果此方法成功,则行集的当前内容将被丢弃,并且行集的元数据也会被(重新)设置。

rowSetChanged< /a> 事件在此刷新时触发。

如果您询问当数据库服务器上的数据更改时是否可以自动刷新 RowSet:据我所知不可能。您可能不想知道此类更改,具体取决于您的隔离级别、锁定和 MVCC 策略。

Yes, a RowSet can be refreshed. Just call its "execute()" method again.

Per the docs:

If this method is successful, the current contents of the rowset are discarded and the rowset's metadata is also (re)set.

A rowSetChanged event fires upon this refresh.

If you are asking if a RowSet can be automatically refreshed when data is changed on the database server: No way that I know of. You may not want to know of such changes, depending on your isolation level, locking, and MVCC strategy.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文