Use the RaXML utility in your code.
import org.dom4j.Element; import com.sybase.connector.repra.util.*;
RaXMLBuilder raXML = new RaXMLBuilder();
The URI of the xsd. file
The name of the database
The event ID of the current event, which can be any string value
If you want the transaction (<tran>) type to contain multiple database operations, enter:
foo.createTranDocument("file://dbeventstream. xsd","pubs2"","00001001");
If you want the event (<dbevent>) type to contain a single database operation, enter:
foo.createEventDocument("file://dbeventstream. xsd","pubs2"","00001001");
The command
The name of the schema
For example:
Element oper1=foo.addOperation("update","authors"):
The operation element
fieldName
fieldType
fieldValue, the string value of the field
foo.addValue(operl,"au_id","CHAR","0001"); foo.addValue(oper1,"au_num","INT","1");
The field types, as SQL datatypes, are:
TEXT, DATETIME, SMALLDATETIME, MONEY, SMALLMONEY,
NUMERIC, DECIMAL, VARCHAR, CHAR, DATE, TIME
BINARY, IMAGE, VARBINARY
TINYINT, SMALLINT, INT
REAL
FLOAT
BIT
UNICHAR, UNIVARCHAR
UNITEXT
BIGINT, USMALLINT, UINT, UBIGINT
The operation element
fieldName
fieldType
fieldValue
SQL condition: either AND or OR
SQL operator: =, <,>, NOT, and so forth
foo.addWhere (oper1,"au_id","CHAR","0002","AND","=");
foo.write(fileName);
String dataStr=foo.xmlDocString();
Your application must send the dataStr object to the RepConnector connection.