Use the Message Broker Java™ API to
read the table values by accessing and extracting table values.
To read the table values you must first access the table
and then extract the data from each row. To read the table values,
complete one of the following examples:
- Use this example to access and extract the table values
by providing the name of the columns. In this example, noRows is
the number of rows in the table, value is the parameter
that stores the table value, column is the name
of the column in the table, and pp3 is the parameter
ID:
PatternParameterTable paramtable = pim.getParameterTable("pp3");
int noRows = paramtable.getRowCount();
String value;
PatternParameterRow row;
for(int i=0; i<noRows; i++) {
row = paramtable.getRow(i);
value = row.getValue("column");
//insert your code here
}
- Alternatively, if you do not provide the name of the columns,
you can use this example to access and extract the table values by
using the getColumns() method. In this example, noColumns is
the number of columns in the table, value is the
parameter that stores the table value, columns is
an array containing the names of the columns in the table, and pp3 is
the parameter ID:
PatternParameterTable paramtable = pim.getParameterTable("pp3");
int noRows = paramtable.getRowCount();
PatternParameterRow row;
String[] columns;
String value;
for(int i=0; i<noRows; i++) {
row = paramtable.getRow(i);
columns = row.getColumns();
int noColumns = columns.length;
for(int j=0; j<noColumns; j++) {
value = row.getValue(columns[j]);
//insert your code here
}