Progress
Open Client
Developer’s Guide


Getting Metadata For OUTPUT TEMP-TABLE and TABLE-HANDLE Parameters

You can obtain schema information for a standard ResultSet object by accessing the java.sql.ResultSetMetaData object returned by the getMetaData() method on the ResultSet. This ResultSetMetaData object allows you to access the schema information for each column in the ResultSet.

The com.progress.open4gl.ProResultSetMetaData interface is a Progress extension of the java.sql.ResultSetMetaData interface. The extensions in ProResultSetMetaData access the schema information for the ProResultSet object viewed as TEMP-TABLE fields, using the array model. To use these extensions, you must cast the ResultSetMetaData object returned from getMetaData() as a ProResultSetMetaData object:

// In this code, resultOut is a ProResultSet obtained as an output parameter.

java.sql.ResultSetMetaData metaData = resultOut.getMetaData();

// To access the extended set of methods the application does:
com.progress.open4gl.ProResultSetMetaData proMetaData =
   (com.progress.open4gl.ProResultSetMetaData)metaData;

// Now we use proMetaData to access the ProResultSetMetaData extensions 

The rest of this section describes the ProResultSetMetaData methods and how they allow you to view a ProResultSet object both as standard ResultSet columns and Progress TEMP-TABLE fields, using the array model.

Standard Methods In The ProResultSetMetaData Class

The ProResultSetMetaData class has the following public methods:

ProResultSetMetaData Class Extension To java.sql.ResultSetMetaData

All of the methods based directly on the standard java.sql.ResultSetMetaData class view the TEMP-TABLE using the standard SQL flat column model (columns without arrays) and have prototypes that refer to Column or column.

The Progress-oriented methods, which view the TEMP-TABLE using the Progress array field model (fields that can include arrays), have prototypes that refer to Field or field. For more information on the relationship between ResultSet columns and Progress array fields, see the section comparing the flat model and array model for result sets in Programming Concepts."

Although you can access the data using either the SQL or Progress model, both provide equivalent functionality. Table 5–7 shows the correspondence between the ProResultSetMetaData methods.

Table 5–7: Comparing Some Array and Flat Model Methods  
This method
returns the same set of values ...
As
this method ...
getFieldName()
getColumnName()
getFieldProType()
getColumnProType()
getFieldJavaTypeName()
getColumnJavaTypeName()
getFieldTypeName()
getColumnTypeName()


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