Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

using existing registration for CQN

user-5lbz4Mar 24 2023

I did oracle CQN registration from Java application using JDBC driver with the following parameters

      Properties prop = new Properties();
        prop.setProperty(OracleConnection.DCN_NOTIFY_ROWIDS, "true");
        prop.setProperty(OracleConnection.NTF_QOS_RELIABLE, "true");
        prop.setProperty(OracleConnection.DCN_CLIENT_INIT_CONNECTION, "true");

 try (OracleConnection connection = (OracleConnection) DriverManager.getConnection(jdbcUrl, dbUsername, dbPassword)) {

            DatabaseChangeRegistration dcr = ((OracleConnection) connection).registerDatabaseChangeNotification(prop);

            dcr.addListener(this);

            OracleStatement stmt = (OracleStatement) connection.createStatement();
            stmt.setDatabaseChangeRegistration(dcr);
            ResultSet rs = stmt.executeQuery("select * from employees");
...

Oracle Database every time registers a new registration Id and callback, is there any way to use existing one? I want to get all the notifications in case of my application restart.

Comments
Post Details
Added on Mar 24 2023
0 comments
124 views