简体   繁体   English

数据库更改通知 - 如何获得 Oracle 表更改的通知

[英]Database change notification - how get notified of changes in Oracle tables

I tried (and failed) using JDBC to get notifications on changes in database tables.我尝试(但失败了)使用 JDBC 来获取有关数据库表更改的通知。 When looking for answers here I discovered that Database Change Notification was removed from JDBC since 12c.在这里寻找答案时,我发现自 12c 以来,数据库更改通知已从 JDBC 中删除。

So - instead of asking why my code failed my question is - If I cant use the above method how can I get notified of changes in tables?所以 - 我的问题不是问为什么我的代码失败了 - 如果我不能使用上述方法,我怎么能得到表更改的通知? With changes in table I mean inserts, updates and deletes, not changes in ddl.对于表中的更改,我指的是插入、更新和删除,而不是 ddl 中的更改。

Preferably I'd like to be able to register/add listeners programmatically instead of depend on dbadmin to add triggers or plsql scripts in the database.最好我希望能够以编程方式注册/添加侦听器,而不是依赖 dbadmin 在数据库中添加触发器或 plsql 脚本。

Since the code is supposed to work at various client installations I cant be very specific with which Oracle version this is intended for.由于该代码应该适用于各种客户端安装,因此我不能非常具体地说明它适用于哪个 Oracle 版本。 I'm guessing 19 is a reasonable version to aim for.我猜 19 是一个合理的目标版本。

Would Continuous Query Notification fit the bill? 连续查询通知是否符合要求?

The JDBC drivers can register SQL queries with the database and receive notifications in response to the following: JDBC 驱动程序可以向数据库注册 SQL 查询并接收通知以响应以下内容:

DML or DDL changes on the objects associated with the queries与查询关联的对象上的 DML 或 DDL 更改

DML or DDL changes that affect the result set影响结果集的 DML 或 DDL 更改

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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