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 booleanprotected booleanstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionParameterSet(int numParams) Construct a parameter set object for numParams parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanUp()voidvoidbooleanintgetFlags(int position) Information specific to dataset serialized as XML.Retrieve the current value for the InputErrorResetPolicy setting.booleanprotected intgetMappedTableType(int position) intbooleangetOutputCharToLongChar(int position) Retrieve the current value of the OutputErrorResetPolicy setting.getOutputParameter(int p) static StringinOutString(int inOut) booleanisDataGraph(int position) Determine if a parameter is to be represented as a data graph.booleanisMappedTable(int position) booleanisOutput(int position) booleanisResultSet(int position) protected static booleanIsValueType(int dtype) voidsetAllowWidening(boolean allow) voidsetBooleanArrayParameter(int position, boolean[] b, int m, int extentValue) voidsetBooleanArrayParameter(int position, Boolean[] b, int m, int extentValue) voidvoidsetBooleanFunction(boolean isArray, boolean hasHolder, int extentValue) voidsetBooleanParameter(int position, boolean b, int m) voidsetBooleanParameter(int position, Boolean b, int m) voidsetByteArrayParameter(int position, byte[][] b, int m, int extentValue) voidvoidsetByteFunction(boolean isArray, boolean hasHolder, int extentValue) voidsetByteParameter(int position, byte[] b, int m) voidsetCOMHandleArrayParameter(int position, COMHandle[] h, int m, int extentValue) voidvoidsetCOMHandleFunction(boolean isArray, boolean hasHolder, int extentValue) voidsetCOMHandleParameter(int position, COMHandle h, int m) voidsetDataGraphParameter(int position, ProDataGraph r, int m) voidsetDataGraphParameter(int position, ProDataGraph r, int m, boolean mappedTT) voidsetDateArrayParameter(int position, GregorianCalendar[] d, int m, int extentValue) voidvoidsetDateFunction(boolean isArray, boolean hasHolder, int extentValue) voidsetDateParameter(int position, GregorianCalendar d, int m) voidsetDateTimeArrayParameter(int position, GregorianCalendar[] d, int m, int extentValue) voidvoidsetDateTimeFunction(boolean isArray, boolean hasHolder, int extentValue) voidsetDateTimeParameter(int position, GregorianCalendar d, int m) voidsetDateTimeTzArrayParameter(int position, GregorianCalendar[] d, int m, int extentValue) voidvoidsetDateTimeTzFunction(boolean isArray, boolean hasHolder, int extentValue) voidsetDateTimeTzParameter(int position, GregorianCalendar d, int m) voidsetDecimalArrayParameter(int position, BigDecimal[] d, int m, int extentValue) voidvoidsetDecimalFunction(boolean isArray, boolean hasHolder, int extentValue) voidsetDecimalParameter(int position, BigDecimal d, int m) voidsetDynDataGraphParameter(int position, ProDataGraph r, int m) voidsetDynDataGraphParameter(int position, ProDataGraph r, int m, boolean mappedTT) voidsetDynResultSetParameter(int position, ResultSet r, int m) voidsetHandleArrayParameter(int position, Handle[] h, int m, int extentValue) voidvoidsetHandleFunction(boolean isArray, boolean hasHolder, int extentValue) voidsetHandleParameter(int position, Handle h, int m) voidsetInOut(DataGraphMetaData metaData, int inOut) voidAssign the policy that controls the reset behavior of the ParameterSet when an error occurs processing the input side of an appserver request.voidsetInt64ArrayParameter(int position, long[] l, int m, int extentValue) voidsetInt64ArrayParameter(int position, Long[] l, int m, int extentValue) voidvoidsetInt64Function(boolean isArray, boolean hasHolder, int extentValue) voidsetInt64Parameter(int position, long l, int m) voidsetInt64Parameter(int position, Long l, int m) voidsetIntegerArrayParameter(int position, int[] n, int m, int extentValue) voidsetIntegerArrayParameter(int position, Integer[] n, int m, int extentValue) voidvoidsetIntegerFunction(boolean isArray, boolean hasHolder, int extentValue) voidsetIntegerParameter(int position, int n, int m) voidsetIntegerParameter(int position, Integer n, int m) voidsetIsFuncReturnExtent(boolean bIsExtent) voidsetIsMappedTable(int position, boolean mappedTT) voidsetIsReturnUnknown(boolean bIsUnknown) voidsetLongArrayParameter(int position, long[] l, int m, int extentValue) voidsetLongArrayParameter(int position, Long[] l, int m, int extentValue) voidsetLongcharArrayParameter(int position, String[] s, int m, int extentValue) voidvoidsetLongcharParameter(int position, String s, int m) voidvoidsetLongFunction(boolean isArray, boolean hasHolder, int extentValue) voidsetLongParameter(int position, long l, int m) voidsetLongParameter(int position, Long l, int m) voidsetMemptrArrayParameter(int position, Memptr[] p, int m, int extentValue) voidvoidsetMemptrParameter(int position, Memptr p, int m) voidAssign the policy that controls the reset behavior of the ParameterSet when an error occurs processing the output side of an appserver request.voidsetParameter(int p, Object v, int m, int proType, boolean isExtent, int extentValue) Set the attributes of a parameter in the set.voidsetParameter(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.voidsetParamNum(DataGraphMetaData metaData, int position) voidsetResultSetParameter(int position, ResultSet r, int m) voidsetRowidArrayParameter(int position, Rowid[] r, int m, int extentValue) voidvoidsetRowidFunction(boolean isArray, boolean hasHolder, int extentValue) voidsetRowidParameter(int position, Rowid r, int m) voidsetStringArrayParameter(int position, String[] s, int m, int extentValue) voidvoidsetStringFunction(boolean isArray, boolean hasHolder, int extentValue) voidsetStringParameter(int position, String s, int m) voidvalidate()
-
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_BIandMemptr.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,OUTPUTorINPUT|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 ifisExtentistrue.- Throws:
Open4GLException- ifmis 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,OUTPUTorINPUT|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 ifisExtentistrue.serializeFormat- int indicating that the value stored in the parameter specified bypwill 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 ifserializeFormatis1.- Throws:
Open4GLException- if there are invalid parameters:mis an invalid valueproTypeis neitherParameter.PRO_DATASETnorParameter.PRO_DATASETHANDLEandisSerializedXmlistrue.
-
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()
-