【发布时间】:2012-08-23 17:17:32
【问题描述】:
我正在使用oracle.jdbc.dcn.DatabaseChangeListener 将插入/更新/删除记录到表中。对于插入,我可以跟踪 rowid。但是,我在更新和删除方面遇到了问题。
对于更新,我正在寻找一种方法来找出更新之前的行/列的值。
对于删除,我得到了被删除的 rowid,但这就是我得到的全部。我想要某种能力来跟踪删除了哪一行。
我正在使用oracle.jdbc.OracleConnection 设置属性。
Properties changeNotifProps = new Properties();
changeNotifProps.put(OracleConnection.DCN_IGNORE_DELETEOP,"false");
changeNotifProps.put(OracleConnection.DCN_IGNORE_INSERTOP, "false");
changeNotifProps.put(OracleConnection.DCN_IGNORE_UPDATEOP , "false");
changeNotifProps.put(OracleConnection.DCN_NOTIFY_CHANGELAG , "0");
changeNotifProps.put(OracleConnection.DCN_NOTIFY_ROWIDS , "true");
changeNotifProps.put(OracleConnection.NTF_LOCAL_HOST , <hostname>);
changeNotifProps.put(OracleConnection.NTF_LOCAL_TCP_PORT , "7115");
return changeNotifProps;
是否可以设置某种属性来检测行的先前值?
编辑:我忘了提到我在数百张桌子上这样做。我无法添加触发器/表来记录更改。我需要记录JVM中的所有变化。
【问题讨论】:
标签: database oracle jdbc change-notification