Sample Java Code for addRow

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

Opcodes are used 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 TIMESTAMP:	 writer.setTimestamp((Date) attValue); break;
	}//switch
}//for loop
rowWriter.endRow();