A ResultsetRow packet contains one row in a result set.
The value of columns can usually be accessed directly, e.g.: context.packet.first_name. However, if the row contains more than one column with a given name, you may need to use getColumnValue and setColumnValue instead.
int sequenceId: the sequence ID for the packet.
String packetType: always "ResultsetRow" - read-only.
List<ColumnDefinitionPacket> columnDefinitions: the column definitions for the result set.
Object getColumnValue(String schema, String table, String column): returns the value of the specified column in the row
String getColumnStringValue(String column, String encoding): returns the value of the specified column in the row, decoded using the specified encoding (see Character sets below).
String getColumnStringValue(String schema, String table, String column, String encoding): returns the value of the specified column in the row, decoded using the specified encoding (see Character sets below).
InputStream getJavaStream(String column): returns the value of the specified column as a Java InputStream. The specified column must be binary (i.e. one of the blob types or varbinary). If the value is null, null is returned. See the bitmap watermark example for a typical application.
void setColumnValue(String schema, String table, String column, Object newValue): sets the value of the specified column.
String setColumnStringValue(String column, String value, String encoding): sets the value of the specified column to the specified string using the specified encoding (see Character sets below). Returns the previous value.
String setColumnStringValue(String schema, String table, String column, String value, String encoding): sets the value of the specified column to the specified string using the specified encoding (see Character sets below). Returns the previous value.
ColumnDefinitionPacket getColumnDefinitionByName(String schema, String table, String column): returns the column definition for the specified column
ColumnDefinitionPacket addColumnDefinition(): adds a new column definition to the result set
ColumnDefinitionPacket removeColumnDefinition(String schema, String table, String column): removes the specified column definition
Object clone(): creates a copy of this row. This is most often used to insert a new row in a result set.
MySQL supports a wide range of character sets, but exactly which character encoding is used depends on a number of factors which are beyond the scope of this documentation -- we'll refer you to the MySQL documentation.
In general, Gallium Data tries to figure out the current character encoding by keeping track of the value of certain system variables, specifically character_set_client (for requests) and character_set_results (for result sets).
However, databases often contain data in other encodings, or database clients often request data using a different encoding. In these cases, Gallium Data may not be able to guess the encoding correctly, in which case you can use the methods getColumnStringValue and setColumnStringValue to specify the encoding.
The complete list of character encodings supported by your copy of MySQL can be seen by executing the command SHOW CHARACTER SET.
The complete list of character encodings supported by Gallium Data can be seen here. Notice that the list do not usually match completely. If Gallium Data sees an encoding that it does not support, it will assume UTF-8, which is usually not ideal. In those cases, you can use the special encoding "binary" with the methods getColumnStringValue and setColumnStringValue, and they will return/accept the raw bytes of the string.