public class ParameterSet
extends java.lang.Object
The ParameterSet is used is two phases: 1) Set ALL the parameters (INPUT, OUTPUT or INPUT_OUTPUT) 2) After the execution of the 4GL procedure - get the output values (don't get them if you don't want to. The object can be reused for another call. When setParameter() is called, the object is cleaned up, so the output from the previous call gets lost. The setParameter() calls are currently set to NOT check the validity of the data type and the input/output mode since the assumption is that our ProWrap tool rather than a user would use this interface. make a setParameter (... false) rather then setParameter (... true) calls if you want to change that. Marshaling and unmarshaling of parameters is done by describing a set of parameters as a relational table. That way, the same code the was implemented to marshal and unmarshal Temp-Tables into and from sql result sets can be used to marshal and unmarshal scalar data. The ParameterMetaData.java class (in this package), describes an input parameter value as the tuple: Unspecified value, int proType, int inOut_mode The data type of "value" is unspecified since unlike "real" relational data, not all the value of a parameter set have the same data type. The ParameterMetaData.java class (in this package), describes an output parameter value as the tuple: {int paramNum, int proType, Unspecified value) Note that output parameters don't need the inOut_mode descriptor but instead require the paramNum descriptor (since only OUTPUT and INPUT-OUTPUT parametrs are sent back), so ParameterMetaData and ParameterMetaData are not identical.
Modifier and Type | Field and Description |
---|---|
protected boolean |
funcHasHolder |
protected boolean |
funcIsExtent |
static int |
INPUT |
static int |
INPUT_OUTPUT |
static int |
OUTPUT |
Constructor and Description |
---|
ParameterSet(int numParams)
Construct a parameter set object for numParams parameters.
|
ParameterSet(ParameterSet ps) |
Modifier and Type | Method and Description |
---|---|
void |
cleanUp() |
void |
cleanupOnInputErrors() |
void |
cleanupOutputErrors() |
boolean |
getAllowWidening() |
int |
getFlags(int position)
Information specific to dataset serialized as XML.
|
java.lang.Object |
getFunctionReturnValue() |
InputErrorResetPolicy |
getInputErrorResetPolicy()
Retrieve the current value for the InputErrorResetPolicy setting.
|
boolean |
getIsFunctionReturnExtent() |
protected int |
getMappedTableType(int position) |
int |
getNumParams() |
boolean |
getOutputCharToLongChar(int position) |
OutputErrorResetPolicy |
getOutputErrorResetPolicy()
Retrieve the current value of the OutputErrorResetPolicy setting.
|
java.lang.Object |
getOutputParameter(int p) |
java.lang.Object |
getProcedureReturnValue() |
static java.lang.String |
inOutString(int inOut) |
boolean |
isDataGraph(int position)
Determine if a parameter is to be represented as a data graph.
|
boolean |
isMappedTable(int position) |
boolean |
isOutput(int position) |
boolean |
isResultSet(int position) |
protected static boolean |
IsValueType(int dtype) |
void |
setAllowWidening(boolean allow) |
void |
setBooleanArrayParameter(int position,
boolean[] b,
int m,
int extentValue) |
void |
setBooleanArrayParameter(int position,
java.lang.Boolean[] b,
int m,
int extentValue) |
void |
setBooleanFunction() |
void |
setBooleanFunction(boolean isArray,
boolean hasHolder,
int extentValue) |
void |
setBooleanParameter(int position,
boolean b,
int m) |
void |
setBooleanParameter(int position,
java.lang.Boolean b,
int m) |
void |
setByteArrayParameter(int position,
byte[][] b,
int m,
int extentValue) |
void |
setByteFunction() |
void |
setByteFunction(boolean isArray,
boolean hasHolder,
int extentValue) |
void |
setByteParameter(int position,
byte[] b,
int m) |
void |
setCOMHandleArrayParameter(int position,
COMHandle[] h,
int m,
int extentValue) |
void |
setCOMHandleFunction() |
void |
setCOMHandleFunction(boolean isArray,
boolean hasHolder,
int extentValue) |
void |
setCOMHandleParameter(int position,
COMHandle h,
int m) |
void |
setDataGraphParameter(int position,
ProDataGraph r,
int m) |
void |
setDataGraphParameter(int position,
ProDataGraph r,
int m,
boolean mappedTT) |
void |
setDateArrayParameter(int position,
java.util.GregorianCalendar[] d,
int m,
int extentValue) |
void |
setDateFunction() |
void |
setDateFunction(boolean isArray,
boolean hasHolder,
int extentValue) |
void |
setDateParameter(int position,
java.util.GregorianCalendar d,
int m) |
void |
setDateTimeArrayParameter(int position,
java.util.GregorianCalendar[] d,
int m,
int extentValue) |
void |
setDateTimeFunction() |
void |
setDateTimeFunction(boolean isArray,
boolean hasHolder,
int extentValue) |
void |
setDateTimeParameter(int position,
java.util.GregorianCalendar d,
int m) |
void |
setDateTimeTzArrayParameter(int position,
java.util.GregorianCalendar[] d,
int m,
int extentValue) |
void |
setDateTimeTzFunction() |
void |
setDateTimeTzFunction(boolean isArray,
boolean hasHolder,
int extentValue) |
void |
setDateTimeTzParameter(int position,
java.util.GregorianCalendar d,
int m) |
void |
setDecimalArrayParameter(int position,
java.math.BigDecimal[] d,
int m,
int extentValue) |
void |
setDecimalFunction() |
void |
setDecimalFunction(boolean isArray,
boolean hasHolder,
int extentValue) |
void |
setDecimalParameter(int position,
java.math.BigDecimal d,
int m) |
void |
setDynDataGraphParameter(int position,
ProDataGraph r,
int m) |
void |
setDynDataGraphParameter(int position,
ProDataGraph r,
int m,
boolean mappedTT) |
void |
setDynResultSetParameter(int position,
java.sql.ResultSet r,
int m) |
void |
setHandleArrayParameter(int position,
Handle[] h,
int m,
int extentValue) |
void |
setHandleFunction() |
void |
setHandleFunction(boolean isArray,
boolean hasHolder,
int extentValue) |
void |
setHandleParameter(int position,
Handle h,
int m) |
void |
setInOut(DataGraphMetaData metaData,
int inOut) |
void |
setInputErrorResetPolicy(InputErrorResetPolicy policy)
Assign the policy that controls the reset behavior of the ParameterSet when an error
occurs processing the input side of an appserver request.
|
void |
setInt64ArrayParameter(int position,
long[] l,
int m,
int extentValue) |
void |
setInt64ArrayParameter(int position,
java.lang.Long[] l,
int m,
int extentValue) |
void |
setInt64Function() |
void |
setInt64Function(boolean isArray,
boolean hasHolder,
int extentValue) |
void |
setInt64Parameter(int position,
long l,
int m) |
void |
setInt64Parameter(int position,
java.lang.Long l,
int m) |
void |
setIntegerArrayParameter(int position,
int[] n,
int m,
int extentValue) |
void |
setIntegerArrayParameter(int position,
java.lang.Integer[] n,
int m,
int extentValue) |
void |
setIntegerFunction() |
void |
setIntegerFunction(boolean isArray,
boolean hasHolder,
int extentValue) |
void |
setIntegerParameter(int position,
java.lang.Integer n,
int m) |
void |
setIntegerParameter(int position,
int n,
int m) |
void |
setIsFuncReturnExtent(boolean bIsExtent) |
void |
setIsMappedTable(int position,
boolean mappedTT) |
void |
setIsReturnUnknown(boolean bIsUnknown) |
void |
setLongArrayParameter(int position,
long[] l,
int m,
int extentValue) |
void |
setLongArrayParameter(int position,
java.lang.Long[] l,
int m,
int extentValue) |
void |
setLongcharArrayParameter(int position,
java.lang.String[] s,
int m,
int extentValue) |
void |
setLongcharFunction() |
void |
setLongcharParameter(int position,
java.lang.String s,
int m) |
void |
setLongFunction() |
void |
setLongFunction(boolean isArray,
boolean hasHolder,
int extentValue) |
void |
setLongParameter(int position,
long l,
int m) |
void |
setLongParameter(int position,
java.lang.Long l,
int m) |
void |
setMemptrArrayParameter(int position,
Memptr[] p,
int m,
int extentValue) |
void |
setMemptrFunction() |
void |
setMemptrParameter(int position,
Memptr p,
int m) |
void |
setOutputErrorResetPolicy(OutputErrorResetPolicy policy)
Assign the policy that controls the reset behavior of the ParameterSet when an error
occurs processing the output side of an appserver request.
|
void |
setParameter(int p,
java.lang.Object v,
int m,
int proType,
boolean isExtent,
int extentValue)
Set the attributes of a parameter in the set.
|
void |
setParameter(int p,
java.lang.Object v,
int m,
int proType,
boolean isExtent,
int extentValue,
int serializeFormat,
boolean isRpcStyleSoapMessage,
boolean writeBeforeImage)
Set the attributes of a parameter in the set.
|
void |
setParamNum(DataGraphMetaData metaData,
int position) |
void |
setResultSetParameter(int position,
java.sql.ResultSet r,
int m) |
void |
setRowidArrayParameter(int position,
Rowid[] r,
int m,
int extentValue) |
void |
setRowidFunction() |
void |
setRowidFunction(boolean isArray,
boolean hasHolder,
int extentValue) |
void |
setRowidParameter(int position,
Rowid r,
int m) |
void |
setStringArrayParameter(int position,
java.lang.String[] s,
int m,
int extentValue) |
void |
setStringFunction() |
void |
setStringFunction(boolean isArray,
boolean hasHolder,
int extentValue) |
void |
setStringParameter(int position,
java.lang.String s,
int m) |
void |
validate() |
protected boolean funcIsExtent
protected boolean funcHasHolder
public static final int INPUT
public static final int OUTPUT
public static final int INPUT_OUTPUT
public ParameterSet(int numParams)
numParams
- public ParameterSet(ParameterSet ps)
public void setInputErrorResetPolicy(InputErrorResetPolicy policy)
policy
- public InputErrorResetPolicy getInputErrorResetPolicy()
public void setOutputErrorResetPolicy(OutputErrorResetPolicy policy)
policy
- public OutputErrorResetPolicy getOutputErrorResetPolicy()
public static java.lang.String inOutString(int inOut)
protected static boolean IsValueType(int dtype)
public void setBooleanParameter(int position, boolean b, int m) throws Open4GLException
Open4GLException
public void setBooleanArrayParameter(int position, boolean[] b, int m, int extentValue) throws Open4GLException
Open4GLException
public void setIntegerParameter(int position, int n, int m) throws Open4GLException
Open4GLException
public void setIntegerArrayParameter(int position, int[] n, int m, int extentValue) throws Open4GLException
Open4GLException
public void setLongParameter(int position, long l, int m) throws Open4GLException
Open4GLException
public void setLongArrayParameter(int position, long[] l, int m, int extentValue) throws Open4GLException
Open4GLException
public void setInt64Parameter(int position, long l, int m) throws Open4GLException
Open4GLException
public void setInt64Parameter(int position, java.lang.Long l, int m) throws Open4GLException
Open4GLException
public void setInt64ArrayParameter(int position, long[] l, int m, int extentValue) throws Open4GLException
Open4GLException
public void setInt64ArrayParameter(int position, java.lang.Long[] l, int m, int extentValue) throws Open4GLException
Open4GLException
public void setBooleanParameter(int position, java.lang.Boolean b, int m) throws Open4GLException
Open4GLException
public void setBooleanArrayParameter(int position, java.lang.Boolean[] b, int m, int extentValue) throws Open4GLException
Open4GLException
public void setIntegerParameter(int position, java.lang.Integer n, int m) throws Open4GLException
Open4GLException
public void setIntegerArrayParameter(int position, java.lang.Integer[] n, int m, int extentValue) throws Open4GLException
Open4GLException
public void setLongParameter(int position, java.lang.Long l, int m) throws Open4GLException
Open4GLException
public void setLongArrayParameter(int position, java.lang.Long[] l, int m, int extentValue) throws Open4GLException
Open4GLException
public void setDecimalParameter(int position, java.math.BigDecimal d, int m) throws Open4GLException
Open4GLException
public void setDecimalArrayParameter(int position, java.math.BigDecimal[] d, int m, int extentValue) throws Open4GLException
Open4GLException
public void setStringParameter(int position, java.lang.String s, int m) throws Open4GLException
Open4GLException
public void setStringArrayParameter(int position, java.lang.String[] s, int m, int extentValue) throws Open4GLException
Open4GLException
public void setLongcharParameter(int position, java.lang.String s, int m) throws Open4GLException
Open4GLException
public void setLongcharArrayParameter(int position, java.lang.String[] s, int m, int extentValue) throws Open4GLException
Open4GLException
public void setDateParameter(int position, java.util.GregorianCalendar d, int m) throws Open4GLException
Open4GLException
public void setDateArrayParameter(int position, java.util.GregorianCalendar[] d, int m, int extentValue) throws Open4GLException
Open4GLException
public void setDateTimeParameter(int position, java.util.GregorianCalendar d, int m) throws Open4GLException
Open4GLException
public void setDateTimeArrayParameter(int position, java.util.GregorianCalendar[] d, int m, int extentValue) throws Open4GLException
Open4GLException
public void setDateTimeTzParameter(int position, java.util.GregorianCalendar d, int m) throws Open4GLException
Open4GLException
public void setDateTimeTzArrayParameter(int position, java.util.GregorianCalendar[] d, int m, int extentValue) throws Open4GLException
Open4GLException
public void setByteParameter(int position, byte[] b, int m) throws Open4GLException
Open4GLException
public void setByteArrayParameter(int position, byte[][] b, int m, int extentValue) throws Open4GLException
Open4GLException
public void setRowidParameter(int position, Rowid r, int m) throws Open4GLException
Open4GLException
public void setRowidArrayParameter(int position, Rowid[] r, int m, int extentValue) throws Open4GLException
Open4GLException
public void setMemptrParameter(int position, Memptr p, int m) throws Open4GLException
Open4GLException
public void setMemptrArrayParameter(int position, Memptr[] p, int m, int extentValue) throws Open4GLException
Open4GLException
public void setHandleParameter(int position, Handle h, int m) throws Open4GLException
Open4GLException
public void setHandleArrayParameter(int position, Handle[] h, int m, int extentValue) throws Open4GLException
Open4GLException
public void setCOMHandleParameter(int position, COMHandle h, int m) throws Open4GLException
Open4GLException
public void setCOMHandleArrayParameter(int position, COMHandle[] h, int m, int extentValue) throws Open4GLException
Open4GLException
public void setResultSetParameter(int position, java.sql.ResultSet r, int m) throws Open4GLException
Open4GLException
public void setDynResultSetParameter(int position, java.sql.ResultSet r, int m) throws Open4GLException
Open4GLException
public void setDataGraphParameter(int position, ProDataGraph r, int m) throws Open4GLException
Open4GLException
public void setDataGraphParameter(int position, ProDataGraph r, int m, boolean mappedTT) throws Open4GLException
Open4GLException
public void setDynDataGraphParameter(int position, ProDataGraph r, int m) throws Open4GLException
Open4GLException
public void setDynDataGraphParameter(int position, ProDataGraph r, int m, boolean mappedTT) throws Open4GLException
Open4GLException
public java.lang.Object getOutputParameter(int p) throws Open4GLException
Open4GLException
public int getNumParams()
public boolean isOutput(int position)
public boolean isResultSet(int position)
public boolean isMappedTable(int position)
public void setIsMappedTable(int position, boolean mappedTT)
protected int getMappedTableType(int position)
public boolean isDataGraph(int position)
position
- integer indicating which parameter in the list to test.public int getFlags(int position)
Memptr
. Memptr.DSET_BI
and Memptr.RPC_DSET
.position
- 1-based parameter positionh.public boolean getOutputCharToLongChar(int position)
public void cleanupOutputErrors()
public void cleanupOnInputErrors()
public void cleanUp()
public void setParameter(int p, java.lang.Object v, int m, int proType, boolean isExtent, int extentValue) throws Open4GLException
p
- integer identify the 0-based position of the parameter in
the parameter list.v
- Object to be stored in the given parameter object as the
parameter value.m
- integer indicating input, output or input-output mode
(INPUT
, OUTPUT
or INPUT
| OUTPUT
).proType
- integer identifying ABL data type for the specified
parameter.isExtent
- boolean indicaring whether this is a scaler value
(false) or an extent (true).extentValue
- integer giving the length of the extent. Only valid if
isExtent
is true
.Open4GLException
- if m
is an invalid value.public void setParameter(int p, java.lang.Object v, int m, int proType, boolean isExtent, int extentValue, int serializeFormat, boolean isRpcStyleSoapMessage, boolean writeBeforeImage) throws Open4GLException
p
- integer identify the 0-based position of the
parameter in the parameter list.v
- Object to be stored in the given parameter
object as the parameter value.m
- integer indicating input, output or input-output
mode (INPUT
,
OUTPUT
or
INPUT
| OUTPUT
).proType
- integer identifying ABL data type for the
specified parameter.isExtent
- boolean indicating whether this is a scaler
value (false
) or an extent
(true
).extentValue
- integer giving the length of the extent. Only
valid if isExtent
is true
.serializeFormat
- int indicating that the value stored in the
parameter specified by p
will be
represented as an XML or JSON string.isRpcStyleSoapMessage
- boolean to be used to inform the AppServer that
XML serialization will need to be modified RPC
style messages.writeBeforeImage
- boolean indicating whether a before image should
be included when the value is serialized as XML
or JSON. This parameter is only meaningful if
serializeFormat
is 1
.Open4GLException
- if there are invalid parameters:
m
is an invalid valueproType
is neither
Parameter.PRO_DATASET
nor
Parameter.PRO_DATASETHANDLE
and
isSerializedXml
is true
.public void setBooleanFunction()
public void setBooleanFunction(boolean isArray, boolean hasHolder, int extentValue)
public void setIntegerFunction()
public void setIntegerFunction(boolean isArray, boolean hasHolder, int extentValue)
public void setLongFunction()
public void setLongFunction(boolean isArray, boolean hasHolder, int extentValue)
public void setInt64Function()
public void setInt64Function(boolean isArray, boolean hasHolder, int extentValue)
public void setDecimalFunction()
public void setDecimalFunction(boolean isArray, boolean hasHolder, int extentValue)
public void setStringFunction()
public void setStringFunction(boolean isArray, boolean hasHolder, int extentValue)
public void setDateFunction()
public void setDateFunction(boolean isArray, boolean hasHolder, int extentValue)
public void setDateTimeFunction()
public void setDateTimeFunction(boolean isArray, boolean hasHolder, int extentValue)
public void setDateTimeTzFunction()
public void setDateTimeTzFunction(boolean isArray, boolean hasHolder, int extentValue)
public void setByteFunction()
public void setByteFunction(boolean isArray, boolean hasHolder, int extentValue)
public void setRowidFunction()
public void setRowidFunction(boolean isArray, boolean hasHolder, int extentValue)
public void setMemptrFunction() throws Open4GLException
Open4GLException
public void setLongcharFunction() throws Open4GLException
Open4GLException
public void setHandleFunction()
public void setHandleFunction(boolean isArray, boolean hasHolder, int extentValue)
public void setCOMHandleFunction()
public void setCOMHandleFunction(boolean isArray, boolean hasHolder, int extentValue)
public java.lang.Object getFunctionReturnValue()
public void setIsFuncReturnExtent(boolean bIsExtent)
public boolean getIsFunctionReturnExtent()
public void setIsReturnUnknown(boolean bIsUnknown)
public java.lang.Object getProcedureReturnValue()
public void setParamNum(DataGraphMetaData metaData, int position)
public void setInOut(DataGraphMetaData metaData, int inOut)
public void validate() throws Open4GLException
Open4GLException
public void setAllowWidening(boolean allow)
public boolean getAllowWidening()