Progress
Open Client
Developer’s Guide


Passing a TEMP-TABLE Or TABLE-HANDLE As an INPUT Parameter

For an input parameter, you provide an instance of a class that implements the java.sql.ResultSet interface. You then pass this class instance directly as the input TEMP-TABLE or TABLE-HANDLE parameter.

Instantiating the Input Parameter

To provide an appropriate class instance as an input parameter, your client application must complete one of the following tasks:

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 Progress.

The two methods you must implement are:

SYNTAX
boolean next() 

Advances the result set cursor to the next row. The cursor is always initially positioned before the first row of the result set, and 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.

NOTE: Make sure the result set 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.

SYNTAX
Object getObject(int columnNum) 

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 4GL procedure.

If there is an array field in the Progress 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 only be one way to get the data and that one way assumes the flat column model native to the standard JDBC ResultSet. For more information on the relationship between the flat column model assumed by JDBC and the Progress field model (which includes arrays), see Programming Concepts."

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 read from a file. Therefore, the exact implementation depends entirely on the specific requirements of your application.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095