Try OpenEdge Now
skip to main content
Java Open Clients
Passing Temp-tables as SQL ResultSet Parameters : Passing a TABLE or TABLE-HANDLE as an INPUT parameter : Using com.progress.open4gl.InputResultSet

Using com.progress.open4gl.InputResultSet

The com.progress.open4gl.InputResultSet abstract class implements the java.sql.ResultSet interface except for two methods that you must implement in your extended class. The proxy calls back through these methods to get the data to pass to ABL.
There are two methods you must implement. The first is:
boolean next()
This advances the ResultSet cursor to the next row. The cursor always is initially positioned before the first row of the ResultSet; as a result, the first time next() is called the cursor moves to the first row. It returns false when there are no more rows.
Caution: Make sure the ResultSet cursor is positioned before the first row if you plan to pass the InputResultSet as an input parameter, and you want the receiving context to have access to all rows from the beginning of the InputResultSet. Only rows after the current cursor position are passed to the AppServer.
The second method is:
Object getObject(int columnNum)
Obtains the value of an individual column as an object. The columnNum parameter is a 1-based index indicating which column value to get. This must correctly map to the order in which the temp-table fields are defined in the ABL procedure.
If there is an array field in the temp-table, it is treated as a flattened set of columns by this method. On input, since the proxy is calling back to the client, there can be only one way to get the data, and that one way assumes the flat column model native to the standard JDBC ResultSet.
Your implementation of these methods can differ depending on the data source for the input temp-table. For example, the data might come from an in-memory vector or be read from a file. The exact implementation, therefore, depends on the specific requirements of your application.
You can use the following methods with the InputResultSet class to omit all schema information when marshaling data from the Java Open Client to the AppServer. Using these methods suppresses index descriptions and all field information and aids in faster transmission of data, thereby increasing the performance of your application. You can use these methods when the receiving side knows the schema definition for the table and validation is not necessary.
The following method tells the proxy to marshal the specified InputResultSet from the Java client to the AppServer without schema information, when flag is set to true:
void setNoSchemaMarshal(boolean flag)
The corresponding ABL temp-table on the AppServer must have the same schema as the ResultSet on the client.
The Java Open Client generates a RunTime4GLErrorException when:
*The ABL temp-table's schema does not match the incoming data from the Java client
*flag is set to true and the InputResultSet is passed to a TABLE-HANDLE parameter on the AppServer
The following method on the InputResultSet returns true if the proxy will not marshal schema information to the AppServer; it returns false if it will marshall information:
boolean getNoSchemaMarshal()