SQLFire 1.1

com.vmware.sqlfire.procedure
Interface OutgoingResultSet


public interface OutgoingResultSet

An interface for constructing an outgoing result set by adding rows as List. addColumn(java.lang.String) is used for specifying the column names for this result set. If addRow(java.util.List) is called before addColumn(java.lang.String), then the column names will default to "c1", "c2", etc. The types of the columns will always be Types.JAVA_OBJECT. Once {{addRow}} has been called, an invocation of {{addColumn}} will throw an IllegalStateException.


Field Summary
static int DEFAULT_BATCH_SIZE
          The default number of rows batched up before being flushed as a message to the originating node.
 
Method Summary
 void addColumn(String name)
          Specify the name of the next column for this results set.
 void addRow(List<Object> row)
          Add a row to this result set, to be sent to the ResultCollector.
 void endResults()
          Invoke this method to let the result set know that there are no more rows to be added.
 int getBatchSize()
          Get the number of rows batched up before being flushed as a message to the originating node.
 void setBatchSize(int size)
          Set the number of rows to be batched up before being flushed as a message to the originating node.
 

Field Detail

DEFAULT_BATCH_SIZE

static final int DEFAULT_BATCH_SIZE
The default number of rows batched up before being flushed as a message to the originating node.

See Also:
Constant Field Values
Method Detail

addColumn

void addColumn(String name)
Specify the name of the next column for this results set. The names for all the columns should be specified before addRow(java.util.List) is called, unless the default names are desired. Default column names will be used for any columns that have not been named by calling this method: "c1", "c2", etc.

Parameters:
name - the name of the column
Throws:
IllegalStateException - if rows have already been added when this method is called.

addRow

void addRow(List<Object> row)
Add a row to this result set, to be sent to the ResultCollector. The column descriptions should be added with addColumn(java.lang.String) before this method is called, otherwise default column descriptions will be inferred based on the first row added with columns named "c1", "c2", etc.

Parameters:
row - a List for this row. Each element will be converted to the corresponding SQL type.
Throws:
IllegalArgumentException - if the row is not of the correct length based on previous calls to addColumn.

endResults

void endResults()
Invoke this method to let the result set know that there are no more rows to be added.


getBatchSize

int getBatchSize()
Get the number of rows batched up before being flushed as a message to the originating node. If not set explicitly for this result set using setBatchSize(int) then default is DEFAULT_BATCH_SIZE.


setBatchSize

void setBatchSize(int size)
Set the number of rows to be batched up before being flushed as a message to the originating node.


SQLFire 1.1

Copyright © 2010-2013 VMware, Inc. All rights reserved.