Class ParameterSet
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
protected boolean
static final int
static final int
static final int
-
Constructor Summary
ConstructorsConstructorDescriptionParameterSet
(int numParams) Construct a parameter set object for numParams parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanUp()
void
void
boolean
int
getFlags
(int position) Information specific to dataset serialized as XML.Retrieve the current value for the InputErrorResetPolicy setting.boolean
protected int
getMappedTableType
(int position) int
boolean
getOutputCharToLongChar
(int position) Retrieve the current value of the OutputErrorResetPolicy setting.getOutputParameter
(int p) static 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, Boolean[] b, int m, int extentValue) void
void
setBooleanFunction
(boolean isArray, boolean hasHolder, int extentValue) void
setBooleanParameter
(int position, boolean b, int m) void
setBooleanParameter
(int position, Boolean b, int m) void
setByteArrayParameter
(int position, byte[][] b, int m, int extentValue) void
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
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, GregorianCalendar[] d, int m, int extentValue) void
void
setDateFunction
(boolean isArray, boolean hasHolder, int extentValue) void
setDateParameter
(int position, GregorianCalendar d, int m) void
setDateTimeArrayParameter
(int position, GregorianCalendar[] d, int m, int extentValue) void
void
setDateTimeFunction
(boolean isArray, boolean hasHolder, int extentValue) void
setDateTimeParameter
(int position, GregorianCalendar d, int m) void
setDateTimeTzArrayParameter
(int position, GregorianCalendar[] d, int m, int extentValue) void
void
setDateTimeTzFunction
(boolean isArray, boolean hasHolder, int extentValue) void
setDateTimeTzParameter
(int position, GregorianCalendar d, int m) void
setDecimalArrayParameter
(int position, BigDecimal[] d, int m, int extentValue) void
void
setDecimalFunction
(boolean isArray, boolean hasHolder, int extentValue) void
setDecimalParameter
(int position, 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, ResultSet r, int m) void
setHandleArrayParameter
(int position, Handle[] h, int m, int extentValue) void
void
setHandleFunction
(boolean isArray, boolean hasHolder, int extentValue) void
setHandleParameter
(int position, Handle h, int m) void
setInOut
(DataGraphMetaData metaData, int inOut) void
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, Long[] l, int m, int extentValue) void
void
setInt64Function
(boolean isArray, boolean hasHolder, int extentValue) void
setInt64Parameter
(int position, long l, int m) void
setInt64Parameter
(int position, Long l, int m) void
setIntegerArrayParameter
(int position, int[] n, int m, int extentValue) void
setIntegerArrayParameter
(int position, Integer[] n, int m, int extentValue) void
void
setIntegerFunction
(boolean isArray, boolean hasHolder, int extentValue) void
setIntegerParameter
(int position, int n, int m) void
setIntegerParameter
(int position, Integer 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, Long[] l, int m, int extentValue) void
setLongcharArrayParameter
(int position, String[] s, int m, int extentValue) void
void
setLongcharParameter
(int position, String s, int m) void
void
setLongFunction
(boolean isArray, boolean hasHolder, int extentValue) void
setLongParameter
(int position, long l, int m) void
setLongParameter
(int position, Long l, int m) void
setMemptrArrayParameter
(int position, Memptr[] p, int m, int extentValue) void
void
setMemptrParameter
(int position, Memptr p, int m) void
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, Object v, int m, int proType, boolean isExtent, int extentValue) Set the attributes of a parameter in the set.void
setParameter
(int p, 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, ResultSet r, int m) void
setRowidArrayParameter
(int position, Rowid[] r, int m, int extentValue) void
void
setRowidFunction
(boolean isArray, boolean hasHolder, int extentValue) void
setRowidParameter
(int position, Rowid r, int m) void
setStringArrayParameter
(int position, String[] s, int m, int extentValue) void
void
setStringFunction
(boolean isArray, boolean hasHolder, int extentValue) void
setStringParameter
(int position, String s, int m) void
validate()
-
Field Details
-
funcIsExtent
protected boolean funcIsExtent -
funcHasHolder
protected boolean funcHasHolder -
INPUT
public static final int INPUT- See Also:
-
OUTPUT
public static final int OUTPUT- See Also:
-
INPUT_OUTPUT
public static final int INPUT_OUTPUT- See Also:
-
-
Constructor Details
-
ParameterSet
public ParameterSet(int numParams) Construct a parameter set object for numParams parameters.- Parameters:
numParams
-
-
ParameterSet
-
-
Method Details
-
setInputErrorResetPolicy
Assign the policy that controls the reset behavior of the ParameterSet when an error occurs processing the input side of an appserver request.- Parameters:
policy
-
-
getInputErrorResetPolicy
Retrieve the current value for the InputErrorResetPolicy setting.- Returns:
-
setOutputErrorResetPolicy
Assign the policy that controls the reset behavior of the ParameterSet when an error occurs processing the output side of an appserver request.- Parameters:
policy
-
-
getOutputErrorResetPolicy
Retrieve the current value of the OutputErrorResetPolicy setting.- Returns:
-
inOutString
-
IsValueType
protected static boolean IsValueType(int dtype) -
setBooleanParameter
- Throws:
Open4GLException
-
setBooleanArrayParameter
public void setBooleanArrayParameter(int position, boolean[] b, int m, int extentValue) throws Open4GLException - Throws:
Open4GLException
-
setIntegerParameter
- Throws:
Open4GLException
-
setIntegerArrayParameter
public void setIntegerArrayParameter(int position, int[] n, int m, int extentValue) throws Open4GLException - Throws:
Open4GLException
-
setLongParameter
- Throws:
Open4GLException
-
setLongArrayParameter
public void setLongArrayParameter(int position, long[] l, int m, int extentValue) throws Open4GLException - Throws:
Open4GLException
-
setInt64Parameter
- Throws:
Open4GLException
-
setInt64Parameter
- Throws:
Open4GLException
-
setInt64ArrayParameter
public void setInt64ArrayParameter(int position, long[] l, int m, int extentValue) throws Open4GLException - Throws:
Open4GLException
-
setInt64ArrayParameter
public void setInt64ArrayParameter(int position, Long[] l, int m, int extentValue) throws Open4GLException - Throws:
Open4GLException
-
setBooleanParameter
- Throws:
Open4GLException
-
setBooleanArrayParameter
public void setBooleanArrayParameter(int position, Boolean[] b, int m, int extentValue) throws Open4GLException - Throws:
Open4GLException
-
setIntegerParameter
- Throws:
Open4GLException
-
setIntegerArrayParameter
public void setIntegerArrayParameter(int position, Integer[] n, int m, int extentValue) throws Open4GLException - Throws:
Open4GLException
-
setLongParameter
- Throws:
Open4GLException
-
setLongArrayParameter
public void setLongArrayParameter(int position, Long[] l, int m, int extentValue) throws Open4GLException - Throws:
Open4GLException
-
setDecimalParameter
- Throws:
Open4GLException
-
setDecimalArrayParameter
public void setDecimalArrayParameter(int position, BigDecimal[] d, int m, int extentValue) throws Open4GLException - Throws:
Open4GLException
-
setStringParameter
- Throws:
Open4GLException
-
setStringArrayParameter
public void setStringArrayParameter(int position, String[] s, int m, int extentValue) throws Open4GLException - Throws:
Open4GLException
-
setLongcharParameter
- Throws:
Open4GLException
-
setLongcharArrayParameter
public void setLongcharArrayParameter(int position, String[] s, int m, int extentValue) throws Open4GLException - Throws:
Open4GLException
-
setDateParameter
- Throws:
Open4GLException
-
setDateArrayParameter
public void setDateArrayParameter(int position, GregorianCalendar[] d, int m, int extentValue) throws Open4GLException - Throws:
Open4GLException
-
setDateTimeParameter
- Throws:
Open4GLException
-
setDateTimeArrayParameter
public void setDateTimeArrayParameter(int position, GregorianCalendar[] d, int m, int extentValue) throws Open4GLException - Throws:
Open4GLException
-
setDateTimeTzParameter
public void setDateTimeTzParameter(int position, GregorianCalendar d, int m) throws Open4GLException - Throws:
Open4GLException
-
setDateTimeTzArrayParameter
public void setDateTimeTzArrayParameter(int position, GregorianCalendar[] d, int m, int extentValue) throws Open4GLException - Throws:
Open4GLException
-
setByteParameter
- Throws:
Open4GLException
-
setByteArrayParameter
public void setByteArrayParameter(int position, byte[][] b, int m, int extentValue) throws Open4GLException - Throws:
Open4GLException
-
setRowidParameter
- Throws:
Open4GLException
-
setRowidArrayParameter
public void setRowidArrayParameter(int position, Rowid[] r, int m, int extentValue) throws Open4GLException - Throws:
Open4GLException
-
setMemptrParameter
- Throws:
Open4GLException
-
setMemptrArrayParameter
public void setMemptrArrayParameter(int position, Memptr[] p, int m, int extentValue) throws Open4GLException - Throws:
Open4GLException
-
setHandleParameter
- Throws:
Open4GLException
-
setHandleArrayParameter
public void setHandleArrayParameter(int position, Handle[] h, int m, int extentValue) throws Open4GLException - Throws:
Open4GLException
-
setCOMHandleParameter
- Throws:
Open4GLException
-
setCOMHandleArrayParameter
public void setCOMHandleArrayParameter(int position, COMHandle[] h, int m, int extentValue) throws Open4GLException - Throws:
Open4GLException
-
setResultSetParameter
- Throws:
Open4GLException
-
setDynResultSetParameter
- Throws:
Open4GLException
-
setDataGraphParameter
- Throws:
Open4GLException
-
setDataGraphParameter
public void setDataGraphParameter(int position, ProDataGraph r, int m, boolean mappedTT) throws Open4GLException - Throws:
Open4GLException
-
setDynDataGraphParameter
- Throws:
Open4GLException
-
setDynDataGraphParameter
public void setDynDataGraphParameter(int position, ProDataGraph r, int m, boolean mappedTT) throws Open4GLException - Throws:
Open4GLException
-
getOutputParameter
- Throws:
Open4GLException
-
getNumParams
public int getNumParams() -
isOutput
public boolean isOutput(int position) -
isResultSet
public boolean isResultSet(int position) -
isMappedTable
public boolean isMappedTable(int position) -
setIsMappedTable
public void setIsMappedTable(int position, boolean mappedTT) -
getMappedTableType
protected int getMappedTableType(int position) -
isDataGraph
public boolean isDataGraph(int position) Determine if a parameter is to be represented as a data graph. Only datasets can be represented as data graphs. However, it is also possible for a dataset to be represented as an XML document or JSON string.- Parameters:
position
- integer indicating which parameter in the list to test.- Returns:
- a boolean indicating that the parameter is a dataset that is represented as a data graph.
-
getFlags
public int getFlags(int position) Information specific to dataset serialized as XML. Includes flags fromMemptr
.Memptr.DSET_BI
andMemptr.RPC_DSET
.- Parameters:
position
- 1-based parameter positionh.- Returns:
- integer containing bit flags.
-
getOutputCharToLongChar
public boolean getOutputCharToLongChar(int position) -
cleanupOutputErrors
public void cleanupOutputErrors() -
cleanupOnInputErrors
public void cleanupOnInputErrors() -
cleanUp
public void cleanUp() -
setParameter
public void setParameter(int p, Object v, int m, int proType, boolean isExtent, int extentValue) throws Open4GLException Set the attributes of a parameter in the set. This is used by the Open Java Client. This overloading assumes the parameter will not be serialized XML.- Parameters:
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
orINPUT
|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 ifisExtent
istrue
.- Throws:
Open4GLException
- ifm
is an invalid value.
-
setParameter
public void setParameter(int p, Object v, int m, int proType, boolean isExtent, int extentValue, int serializeFormat, boolean isRpcStyleSoapMessage, boolean writeBeforeImage) throws Open4GLException Set the attributes of a parameter in the set. This is used by the Open Java Client.- Parameters:
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
orINPUT
|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 ifisExtent
istrue
.serializeFormat
- int indicating that the value stored in the parameter specified byp
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 ifserializeFormat
is1
.- Throws:
Open4GLException
- if there are invalid parameters:m
is an invalid valueproType
is neitherParameter.PRO_DATASET
norParameter.PRO_DATASETHANDLE
andisSerializedXml
istrue
.
-
setBooleanFunction
public void setBooleanFunction() -
setBooleanFunction
public void setBooleanFunction(boolean isArray, boolean hasHolder, int extentValue) -
setIntegerFunction
public void setIntegerFunction() -
setIntegerFunction
public void setIntegerFunction(boolean isArray, boolean hasHolder, int extentValue) -
setLongFunction
public void setLongFunction() -
setLongFunction
public void setLongFunction(boolean isArray, boolean hasHolder, int extentValue) -
setInt64Function
public void setInt64Function() -
setInt64Function
public void setInt64Function(boolean isArray, boolean hasHolder, int extentValue) -
setDecimalFunction
public void setDecimalFunction() -
setDecimalFunction
public void setDecimalFunction(boolean isArray, boolean hasHolder, int extentValue) -
setStringFunction
public void setStringFunction() -
setStringFunction
public void setStringFunction(boolean isArray, boolean hasHolder, int extentValue) -
setDateFunction
public void setDateFunction() -
setDateFunction
public void setDateFunction(boolean isArray, boolean hasHolder, int extentValue) -
setDateTimeFunction
public void setDateTimeFunction() -
setDateTimeFunction
public void setDateTimeFunction(boolean isArray, boolean hasHolder, int extentValue) -
setDateTimeTzFunction
public void setDateTimeTzFunction() -
setDateTimeTzFunction
public void setDateTimeTzFunction(boolean isArray, boolean hasHolder, int extentValue) -
setByteFunction
public void setByteFunction() -
setByteFunction
public void setByteFunction(boolean isArray, boolean hasHolder, int extentValue) -
setRowidFunction
public void setRowidFunction() -
setRowidFunction
public void setRowidFunction(boolean isArray, boolean hasHolder, int extentValue) -
setMemptrFunction
- Throws:
Open4GLException
-
setLongcharFunction
- Throws:
Open4GLException
-
setHandleFunction
public void setHandleFunction() -
setHandleFunction
public void setHandleFunction(boolean isArray, boolean hasHolder, int extentValue) -
setCOMHandleFunction
public void setCOMHandleFunction() -
setCOMHandleFunction
public void setCOMHandleFunction(boolean isArray, boolean hasHolder, int extentValue) -
getFunctionReturnValue
-
setIsFuncReturnExtent
public void setIsFuncReturnExtent(boolean bIsExtent) -
getIsFunctionReturnExtent
public boolean getIsFunctionReturnExtent() -
setIsReturnUnknown
public void setIsReturnUnknown(boolean bIsUnknown) -
getProcedureReturnValue
-
setParamNum
-
setInOut
-
validate
- Throws:
Open4GLException
-
setAllowWidening
public void setAllowWidening(boolean allow) -
getAllowWidening
public boolean getAllowWidening()
-