org.postgresql.pljava.example
Class TupleReturn

java.lang.Object
  extended by org.postgresql.pljava.example.TupleReturn
All Implemented Interfaces:
ResultSetProvider

public class TupleReturn
extends Object
implements ResultSetProvider

Author:
Thomas Hallgren

Constructor Summary
TupleReturn(int base, int increment)
           
 
Method Summary
 boolean assignRowValues(ResultSet receiver, int currentRow)
          This method is called once for each row that should be returned from a procedure that returns a set of rows.
 void close()
          Called after the last row has returned or when the query evaluator decides that it does not need any more rows.
static String makeString(ResultSet _testSetReturn)
           
static ResultSetProvider setReturn(int base, int increment)
           
static boolean tupleReturn(int base, int increment, ResultSet receiver)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TupleReturn

public TupleReturn(int base,
                   int increment)
Method Detail

assignRowValues

public boolean assignRowValues(ResultSet receiver,
                               int currentRow)
                        throws SQLException
Description copied from interface: ResultSetProvider
This method is called once for each row that should be returned from a procedure that returns a set of rows. The receiver is a SingleRowWriter writer instance that is used for capturing the data for the row.

Specified by:
assignRowValues in interface ResultSetProvider
Parameters:
receiver - Receiver of values for the given row.
currentRow - Row number. First call will have row number 0.
Returns:
true if a new row was provided, false if not (end of data).
Throws:
SQLException

close

public void close()
Description copied from interface: ResultSetProvider
Called after the last row has returned or when the query evaluator decides that it does not need any more rows.

Specified by:
close in interface ResultSetProvider

setReturn

public static ResultSetProvider setReturn(int base,
                                          int increment)
                                   throws SQLException
Throws:
SQLException

tupleReturn

public static boolean tupleReturn(int base,
                                  int increment,
                                  ResultSet receiver)
                           throws SQLException
Throws:
SQLException

makeString

public static String makeString(ResultSet _testSetReturn)
                         throws SQLException
Throws:
SQLException