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 thejava.sql.ResultSetMetaData
object returned by thegetMetaData()
method on theResultSet
. ThisResultSetMetaData
object allows you to access the schema information for each column in theResultSet
.The
com.progress.open4gl.ProResultSetMetaData
interface is a Progress extension of thejava.sql.ResultSetMetaData
interface. The extensions inProResultSetMetaData
access the schema information for theProResultSet
object viewed as TEMP-TABLE fields, using the array model. To use these extensions, you must cast theResultSetMetaData
object returned fromgetMetaData()
as aProResultSetMetaData
object:
The rest of this section describes the
ProResultSetMetaData
methods and how they allow you to view aProResultSet
object both as standardResultSet
columns and Progress TEMP-TABLE fields, using the array model.Standard Methods In The ProResultSetMetaData Class
The
ProResultSetMetaData
class has the following public methods:
- These methods are part of the standard
java.sql.ResultSetMetaData
interface and are useful if the client wants to write standard code that could access any JDBC result set:
The
getColumnType()
method returns anint
constant for the standard SQL types as shown in Table 5–6. The column under SQL Data Type in the table shows the type names as specified by thejava.sql.Types
class.
The
getColumnTypeName()
method returns the corresponding Progress data type names shown in Table 5–6 under Progress Data Type.
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 toColumn
orcolumn
.
- These methods allow you to see the data type of each result set column as Progress and Java types:
Returns one of the following values accessible from
com.progress.open4gl.Parameter:
PRO_CHARACTER = 1;
PRO_DATE = 2;
PRO_LOGICAL = 3;
PRO_INTEGER = 4;
PRO_DECIMAL = 5;
PRO_RECID = 7;
PRO_RAW = 8;
PRO_WIDGETHANDLE = 10;
PRO_ROWID = 13;
PRO_COMHANDLE = 14;
getColumnJavaTypeName()
returns the name of the Java class that each Progress data type maps to. For information on these mappings, see Table 5–3.- These methods provide access to the schema of TEMP-TABLE parameters that contain array fields, viewed from a Progress point of view:
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
orfield
. For more information on the relationship betweenResultSet
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.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |