Compile and run the sample, and include the repraconn.jar file in your CLASSPATH.
On Windows, enter:
java- classpath.:%REPRA_HOME%\lib\repraconn.jar: %REPRA_HOME% \lib\dom4j-full.jar UseXMLBuildertext.xml
On UNIX, enter:
java- classpath.:$REPRA_HOME/lib/repraconn.jar:$REPRA_ HOME/lib/dom4j-full,jar UseXMLBuildertest.xml
The result:
Output of multiple update db events in a single transaction: <?xml version="1.0" encoding="UTF-8"?>
dbStream xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file://dbeventstream.xsd" environment="pubs2"> <tran eventId="00001001">
<update schema="authors"> <values> <cell name="au_id" type="CHAR">0001</cell> <cell name="address" type="VARCHAR">1 Sybase</cell> <values> <oldValues> <cell name="au_id" type="CHAR" operator="=">0002</cell> <cell name="address" type="VARCHAR" condition="AND" operator="=">3 Sybase</cell> </oldValues> </update> <delete schema="authors"> <values> <cell name="au_id" type="CHAR">0001</cell> <cell name="address" type="VARCHAR">1 Sybase</cell> </values> </oldValues> <cell name="au_id" type="CHAR" operator="=">0002</cell> <cell name="address" type="VARCHAR" condition="AND" operator="=">3 Sybase</cell> </oldValues> </delete> </update> </tran> </dbStream> Output of multiple dbevents in a transaction: <?xml version="1.0" encoding="UTF-8"?> dbStream xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file://dbeventstream.xsd" environment="pubs3"> <tran eventId="00001002"> <update schema="stores"> <values> <cell name="au_id" type="CHAR">0002</cell> <cell name="address" type="VARCHAR">1 Sybase</cell> <values> </oldValues> </update> <exec schema="storesProcedure1"> <inValues> <cell name="au_id" type="CHAR">0002</cell> </inValues> <outValues> <cell name="au_id" type="CHAR">0002</cell> </outValues </exec> </dbEvent> </dbStream> Output of a stored procedure: <?xml version="1.0" encoding="UTF-8"?> dbStream xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file://dbeventstream.xsd" environment="pubs3"> <dbEventId="00001003"> <update schema="storesProcedure1"> <inValues> <cell name="au_id" type="CHAR">0002</cell> </inValues> <outValues> <cell name="au_id" type="CHAR">0002</cell> </outValues </exec> </dbEvent> </dbStream>