Release 10.1A: OpenEdge Development:
Java Open Clients

> ## Adding parameters using a generic method

> You can use the following generic method on the `com.progress.open4gl.javaproxy.ParamArray` class to set the parameters in the `ParamArray`:

> Syntax
>     public void addParameter
>                    (int position, Object value, int mode,
>                     int proType, int extentValue,
>                     com.progress.open4gl.ProResultSetMetaDataImpl metaData)
>                 throws Open4GLException
>     public void addParameter
>                    (int position, Object value, int mode,
>                     int proType, int extentValue,
>                     com.progress.open4gl.ProDataGraphMetaData metaData)
>                 throws Open4GLException

> ``position``

> Specifies a 0-based index indicating the parameter position.

> ``value``

> Specifies a variable of the appropriate `Object` data type that contains the value for the parameter, or `null` for an `OUTPUT` parameter.

> ``mode``

> Specifies the 4GL mode (passing direction) of the parameter. This can be one of the following constant values:

> - `ParamArrayMode.INPUT`
> - `ParamArrayMode.INPUT_OUTPUT`
> - `ParamArrayMode.OUTPUT`
> ``proType``

> Specifies the Progress 4GL data type of the parameter indicated by a class constant defined in the `com.progress.open4gl.Parameter` class, as shown in Table 11–2.

> Table 11–2: Progress 4GL parameter data types for the OpenAPI
> Progress data type | com.progress.open4gl.Parameter class constant
> --- | ---
>     CHARACTER
>     PRO_CHARACTER
>     COM-HANDLE
>     PRO_COMHANDLE
>     DATASET
>     PRO_DATASET
>     DATASET-HANDLE
>     PRO_ DATASETHANDLE
>     DATE
>     PRO_DATE
>     DATETIME
>     PRO_DATETIME
>     DATETIME-TZ
>     PRO_DATETIMETZ
>     DECIMAL
>     PRO_DECIMAL
>     INTEGER
>     PRO_INTEGER
>     LOGICAL
>     PRO_LOGICAL
>     LONGCHAR
>     PRO_LONGCHAR
>     MEMPTR
>     PRO_MEMPTR
>     RAW
>     PRO_RAW
>     RECID
>     PRO_RECID
>     ROWID
>     PRO_ROWID
>     TABLE
>     PRO_TEMPTABLE
>     TABLE-HANDLE
>     PRO_TABLEHANDLE
>     WIDGET-HANDLE
>     PRO_WIDGETHANDLE

> ``extentValue``

> Specifies the extent of an array, zero for a scalar value.

> ``metaData``

> Specifies the schema for ProDataSet or temp-table parameters, where `proType` is one of the following:

> - `Parameter.PRO_DATASET`
> - `Parameter.PRO_DATASETHANDLE`
> - `Parameter.PRO_TEMPTABLE`
> - `Parameter.PRO_TABLEHANDLE`

> The value can be specified using one of the following classes:

> - `ProResultSetMetaDataImpl` — To define the schema information for temp-table parameters that are mapped to a `java.sql.ResultSet`. For more information on defining this schema, see the "Defining the schema for a temp-table parameter mapped to a java.sql.ResultSet" section.
> - `ProDataGraphMetaData` — To define the schema information for ProDataSet parameters and temp-table parameters that are mapped to a com.progress.open4gl.ProDataGraph. For more information on defining the schema for ProDataSet parameters, see the "Defining the schema for a ProDataSet parameter" section. For more information on defining the schema for temp-table parameters mapped to a `ProDataGraph`, see the "Defining the schema for a temp-table parameter mapped to a ProDataGraph" section.

> When `mode` is `ParamArrayMode.OUTPUT` and `proType` is `Parameter.PRO_DATASETHANDLE` or `Parameter.PRO_TABLEHANDLE` (passing a dynamic ProDataSet or temp-table parameter), you can set this parameter to `null`.

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