Sample Java class user exits for the CDC Replication Engine for Microsoft SQL Server
CDC Replication provides sample user exits that you can extend or modify to suit your environment.
The samples are found in samples.jar, which is located in the samples directory in your CDC Replication installation directory. The Java™ file contains the following samples:
- CRUserExitSample.java
- A conflict resolution user exit that can be used with tables having a primary key column of any data type or a numeric column with any data type. This sample is located in com.datamirror.ts.target.publication.userexit.cdr.
- DEUserExitSample.java
- Used in expressions using the %USERFUNC column function. It calculates the sum of the user-supplied parameters (in the expression) and returns the sum incremented by 1. This sample is located in com.datamirror.ts.derivedexpressionmanager.
- SPUserExitSample.java
- Calls a stored procedure with the image coming from the source. This sample is located in com.datamirror.ts.target.publication.userexit.sample.
- UserExitSample.java
- Subscribes to replication events to retrieve the details of the events which took place. This sample is located in com.datamirror.ts.target.publication.userexit.sample.
- UserExitSample1.java
- Records new rows inserted into a table on the target and stores them in a text file. The user specifies the name of the text file as a parameter. This sample is located in com.datamirror.ts.target.publication.userexit.sample.
- VaultExternalSecretStoreUserExitSample.java
- Returns the map loaded with credentials during instance configuration or instance restart. This sample is located in com.datamirror.ts.target.publication.userexit.sample.
Note the following:
- To run the sample user exits without modifying them, you must specify the fully qualified path to the compiled user exit in Management Console. For example, com.datamirror.ts.target.publication.userexit.sample.UserExitSample.
- Compiled sample user exits are located in the ts.jar file, which is found in the lib directory in your IBM® Data Replication installation directory. The compiled user exits in the ts.jar file have a *.class extension.
- If you want to modify the sample user exits, you must compile the user exit after you changes the source code.
- The user exit class must also be in the CDC Replication runtime classpath.
For more information on how to specify Java class or Stored Procedure user exits in Management Console, see your Management Console documentation.