Show TOC

Sample Java Code for addRowLocate this document in the navigation structure

The addRow operation adds a single record row to messages published to the ESP Server.

Use opcodes to update the table with a new row.

Schema schema = stream.getEffectiveSchema();
DataType[] colTypes = schema.getColumnTypes();
rowWriter.startRow();
rowWriter.setOperation(Stream.Operation.UPSERT);
for (int fieldIndex = 0; fieldIndex < schema.getColumnCount(); fieldIndex++) {
	String name = (String) colNames[fieldIndex];
	attValue = record.get(fieldIndex);
switch(dataType){
	case BOOLEAN:	 writer.setBoolean((Boolean) attValue); break;
	case INTEGER:	 writer.setInteger((Integer) attValue); break;
	       case MSDATE:	 writer.setMSDate((Date) attValue); break;
	}//switch
}//for loop
rowWriter.endRow();