Provide metadata for INPUT TABLE-HANDLE parameters
- Last Updated: August 16, 2021
- 2 minute read
- OpenEdge
- Version 12.2
- Documentation
For TABLE parameters, the proxy calls the
next() and getObject()
methods to get the data that needs to be passed to the application server methods. For a
TABLE-HANDLE parameter, the proxy must first obtain a
ResultSetMetaData object by calling the getMetaData() method in order to determine the format of the data.
There are several alternatives for how getMetaData() can supply the appropriate ResultSetMetaData object:
- Use a standard JDBC
ResultSetif:- The input
ResultSetis a standard JDBCResultSetobtained from a query, and the client application does not need to do anything - The
ResultSetinstance already implements thegetMetaData()method and returns a standardResultSetMetaDataobject.
The proxy automatically maps SQL data types to ABL schema data types, as shown in the following table.
Note: Because a standardResultSetsupports a standardResultSetMetaDataobject and not the ABL extension (ProResultSetMetaData), there can be no array fields.Table 1. Mapping between SQL and ABL schema data types for standard JDBC ResultSet SQL type ABL type BIGINTINT64BITLOGICALBLOBBLOBCLOBCLOBDATEDATEDECIMALDECIMALINTEGERINTEGERLONGVARCHARCHARACTERTIMESTAMPDATETIMEVARBINARYRAWIf the
ResultSetcontains any other type, an exception is thrown. - The input
- Extend the OpenEdge
InputResultSetif:- The
ResultSetcontains a column type other than the types shown in the previous table and the column can be converted to a compliant type, implement your ownResultSetclass instead of passing thejava.sql.ResultSetdirectly as the parameter. For example, you can extendcom.progress.open4gl.InputResultSetwith your own class. When
getObject()is called on your class, it retrieves data from the corresponding standard object and converts the data before returning it to the proxy. When thegetMetaData()method is called, the implementation of your extended class must supply the appropriate meta data. To do this, the application must create and populate aProResultSetMetaDataImplobject, as described in ProResultSetMetaDataImpl class.- The application requires the resulting server-side temp-table to have
an array field, this is another reason for you to extend the
InputResultSetclass. This time, the implementation of bothnext()andgetObject()call the standard instance's corresponding methods to do the work. When thegetMetaData()method is called, however, the extending class must supply the required meta data, with the flattened schema view converted to the corresponding array field view. Again, to do this, the application must create and populate aProResultSetMetaDataImplobject, as described in ProResultSetMetaDataImpl class.
- The
- Use the
ResultSetMetaDatafrom a previously obtained outputResultSetunder the following condition:- If the input
ResultSetis aResultSetthat was first obtained from the application server through anOUTPUTparameter, meta data can be obtained from that output set by callinggetMetaData()on it. You can think of this as anOUTPUT-INPUT TABLE-HANDLE, parameter even though it is output from one method call and input through another. TheResultSetMetaDataobject obtained from the outputResultSetcan then be provided whengetMetaData()is called for the inputResultSet.
- If the input