1.1

Table Of Contents
for(int i=0; i<10; ++i) {
List<Object> row=new ArrayList<Object>();
row.add(new Integer(i));
row.add("String"+ i);
ors.addRow(row);
}
ors.endResults();
}
if (number > 2) {
rs3[0] =
c.createStatement().executeQuery("VALUES(1)");
}
if (number > 3) {
rs4[0] =
c.createStatement().executeQuery("VALUES(1)");
}
}
Procedure Result Processor Interfaces
Procedure result processor interfaces are relevant to custom result processors.
ProcedureResultProcessor
ProcedureResultProcessor collates results and OUT parameters from multiple servers.
A custom ProcedureResultProcessor can be implemented to collate results and OUT parameters from multiple
servers in a way that is different from the default behavior. It has these methods:
DescriptionMethod
Provide the out parameters for this procedure to the client as an
Object[].
getOutParameters()
Provide the next row for result set number resultSetNumber. The
processor should do whatever processing is required on the incoming
data to provide the next row.
getNextResultRow(int resultSetNumber)
Called by SQLFire when this statement is closed.close()
Example
A custom Processor Example
Example code showing how to implement a Procedure and a
custom Collector that does a MergeSort.
CREATE PROCEDURE MergeSort ()
LANGUAGE JAVA PARAMETER STYLE JAVA
READS SQL DATA DYNAMIC RESULT SETS 1
EXTERNAL NAME 'examples.MergeSortProcedure.mergeSort'
MergeSortProcedure class
package examples;
import com.vmware.sqlfire.*;
import java.sql.*;
public class MergeSortProcedure {
static final String LOCAL = "<local>";
public static void mergeSort(ResultSet[] outResults,
ProcedureExecutionContext
vFabric SQLFire User's Guide452
vFabric SQLFire Reference