Try OpenEdge Now
skip to main content
Java Open Clients
Passing Temp-tables as SQL ResultSet Parameters : SQL ResultSet streaming and call-back sequence
 

SQL ResultSet streaming and call-back sequence

Java Open Client support for TABLE and TABLE-HANDLE parameters depends on a call-back mechanism used by both the client application and the proxy code. Therefore, either the client application or the proxy always must request data from the sender, rather than having the sender set or send the data. As a result, the client application calls back to the proxy for output parameters, and the proxy calls back to the client application for input parameters.
The following table shows how the call-back sequence works when passing an INPUT TABLE or TABLE-HANDLE parameter.
Table 37. Passing an INPUT temp-table as an SQL ResultSet
Client application
Proxy
1. Creates input ResultSet object
2. Passes ResultSet object as a parameter to proxy
 
3. Uses methods on the input ResultSet object
4. Passes input data to the AppServer
 
The following table shows how the call-back sequence works when passing an OUTPUT TABLE or TABLE-HANDLE parameter.
Table 38. Passing an OUTPUT temp-table as an SQL ResultSet
Client application
Proxy
1.Creates holder object for the output ResultSet
2. Passes holder object to proxy
3.  Gets output data from the AppServer
4.  Creates output ResultSet object and stores it in holder object
5.  Returns to client
6.  Uses methods on the ResultSet contained in the holder object
The following table shows how the call-back sequence works when passing an INPUT-OUTPUT TABLE or TABLE-HANDLE parameter.
Table 39. Passing an INPUT-OUTPUT temp-table as an SQL ResultSet
Client Application
Proxy
1.  Creates holder object
2.  Creates input ResultSet object and stores it in holder
3.  Passes holder object to proxy
4.  Uses methods on the ResultSet in the holder object to get data
5.  Passes input data to the AppServer
6.  Gets output data from the AppServer
7.  Creates output ResultSet object and stores it in holder object
8.  Returns to client
9.  Uses methods on the ResultSet in the holder object to get data
The input ResultSet object is an object written by the Java client application. This also can be a standard ResultSet object available as the result of a SQL query (a java.sql.ResultSet). In contrast, the output ResultSet object always is provided by the generated proxy.
* INPUT ResultSet objects
* OUTPUT ResultSet objects
* Result set schemas