Configuring the RaXMLBuilder

You must include the repraconn.jar file in your CLASSPATH environment variable setting.

For Unix ,enter:

For Windows, enter:

SET CLASSPATH=%REPRA_HOME%\lib\repraconn.jar;/%CLASSPATH%

StepsUsing the RaXML utility in your code

  1. Import the essential modules:

    import org.dom4j.Element;
    import com.sybase.connector.repra.util.*;
    
  2. Create an instance of RaXMLBuilder:

    RaXMLBuilder raXML = new RaXMLBuilder();
    
  3. Get the event body, which requires three parameters:

  4. Add an operation, which requires:

    For example:

    Element oper1=foo.addOperation("update","authors"):
    
  5. Add data to the operation, which requires:

    For example:

    foo.addValue(operl,"au_id","	CHAR","0001");
    foo.addValue(oper1,"au_num","INT","1");
    

    The field types, as SQL datatypes, are:

  6. Add a where clause to the operation, which requires:

    For example:

    foo.addWhere
    		(oper1,"au_id","CHAR","0002","AND","=");
    
  7. Create an XML file:

    foo.write(fileName);
    
  8. Get the String value of the event from the current XML document:

    String dataStr=foo.xmlDocString();
    

    Your application must send the dataStr object to the RepConnector connection.