ParameterValueSet
final class GenericParameterValueSet extends java.lang.Object implements ParameterValueSet
ParameterValueSet
Modifier and Type | Field | Description |
---|---|---|
(package private) ClassInspector |
ci |
|
private boolean |
hasReturnOutputParam |
|
private GenericParameter[] |
parms |
Modifier | Constructor | Description |
---|---|---|
private |
GenericParameterValueSet(int numParms,
GenericParameterValueSet pvs) |
|
(package private) |
GenericParameterValueSet(ClassInspector ci,
int numParms,
boolean hasReturnOutputParam) |
Constructor for a GenericParameterValueSet
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
allAreSet() |
Tells whether all the parameters are set and ready for execution.
|
boolean |
checkNoDeclaredOutputParameters() |
Check that there are not output parameters defined
by the parameter set.
|
private void |
checkPosition(int position) |
Check the position number for a parameter and throw an exception if
it is out of range.
|
void |
clearParameters() |
Sets all parameters to an uninitialized state.
|
ParameterValueSet |
getClone() |
Clone the ParameterValueSet and its contents.
|
(package private) GenericParameter |
getGenericParameter(int position) |
|
DataValueDescriptor |
getParameter(int position) |
Returns the parameter value at the given position.
|
int |
getParameterCount() |
Returns the number of parameters in this set.
|
DataValueDescriptor |
getParameterForGet(int position) |
Get the DataValueDescriptor for an INOUT or OUT parameter.
|
DataValueDescriptor |
getParameterForSet(int position) |
Returns the parameter at the given position in order to set it.
|
short |
getParameterMode(int parameterIndex) |
Return the mode of the parameter according to JDBC 3.0 ParameterMetaData
|
int |
getParameterNumber(GenericParameter theParam) |
Return the parameter number (in jdbc lingo, i.e. 1 based)
for the given parameter.
|
int |
getPrecision(int parameterIndex) |
Return the precision of the given parameter index in this pvs.
|
DataValueDescriptor |
getReturnValueForSet() |
Get the value of the return parameter in order to set it.
|
int |
getScale(int parameterIndex) |
Return the scale of the given parameter index in this pvs.
|
boolean |
hasReturnOutputParameter() |
Is there a return output parameter in this pvs.
|
void |
initialize(DataTypeDescriptor[] types) |
Initialize the set by allocating a holder DataValueDescriptor object
for each parameter.
|
void |
registerOutParameter(int parameterIndex,
int jdbcType,
int scale) |
Mark the parameter as an output parameter.
|
void |
setParameterAsObject(int position,
java.lang.Object value) |
Set the value of this user defined parameter to the passed in Object.
|
void |
setParameterMode(int position,
int mode) |
Set the mode of the parameter, called when setting up static method calls and stored procedures.
|
java.lang.String |
toString() |
|
void |
transferDataValues(ParameterValueSet pvstarget) |
Set the parameter values of the pvstarget to equal those
set in this PVS.
|
void |
validate() |
Validate the parameters.
|
private final GenericParameter[] parms
final ClassInspector ci
private final boolean hasReturnOutputParam
GenericParameterValueSet(ClassInspector ci, int numParms, boolean hasReturnOutputParam)
numParms
- The number of parameters in the new ParameterValueSethasReturnOutputParam
- if we have a ? = call syntax. Note that
this is NOT the same thing as an output parameter -- return
output parameters are special cases of output parameters.private GenericParameterValueSet(int numParms, GenericParameterValueSet pvs)
public void initialize(DataTypeDescriptor[] types) throws StandardException
initialize
in interface ParameterValueSet
types
- expected to match the number of parameters.StandardException
public void setParameterMode(int position, int mode)
ParameterValueSet
setParameterMode
in interface ParameterValueSet
public void clearParameters()
ParameterValueSet
clearParameters
in interface ParameterValueSet
ParameterValueSet.clearParameters()
public int getParameterCount()
getParameterCount
in interface ParameterValueSet
public DataValueDescriptor getParameter(int position) throws StandardException
getParameter
in interface ParameterValueSet
StandardException
- Thrown on errorpublic DataValueDescriptor getParameterForSet(int position) throws StandardException
ParameterValueSet
getParameterForSet
in interface ParameterValueSet
StandardException
- Thrown on errorpublic DataValueDescriptor getParameterForGet(int position) throws StandardException
ParameterValueSet
getParameterForGet
in interface ParameterValueSet
position
- Zero based index of the parameter.StandardException
- Position out of range or the parameter is not INOUT or OUT.public void setParameterAsObject(int position, java.lang.Object value) throws StandardException
ParameterValueSet
setParameterAsObject
in interface ParameterValueSet
StandardException
- Thrown on errorpublic boolean allAreSet()
ParameterValueSet
allAreSet
in interface ParameterValueSet
ParameterValueSet.allAreSet()
public void transferDataValues(ParameterValueSet pvstarget) throws StandardException
ParameterValueSet
transferDataValues
in interface ParameterValueSet
pvstarget
- ParameterValueSet which will recieve the valuesStandardException
- values not compatibleParameterValueSet.transferDataValues(org.apache.derby.iapi.sql.ParameterValueSet)
GenericParameter getGenericParameter(int position)
public java.lang.String toString()
toString
in class java.lang.Object
private void checkPosition(int position) throws StandardException
position
- The position number to checkStandardException
- Thrown if position number is
out of range.public ParameterValueSet getClone()
ParameterValueSet
getClone
in interface ParameterValueSet
public void registerOutParameter(int parameterIndex, int jdbcType, int scale) throws StandardException
registerOutParameter
in interface ParameterValueSet
parameterIndex
- The ordinal parameterIndex of a parameter to set
to the given value.jdbcType
- A type from java.sql.Typesscale
- the scale to use. -1 means ignore scaleStandardException
- on errorpublic void validate() throws StandardException
validate
in interface ParameterValueSet
StandardException
- if the parameters aren't validpublic int getParameterNumber(GenericParameter theParam)
public boolean checkNoDeclaredOutputParameters()
checkNoDeclaredOutputParameters
in interface ParameterValueSet
public short getParameterMode(int parameterIndex)
getParameterMode
in interface ParameterValueSet
parameterIndex
- the first parameter is 1, the second is 2, ...public boolean hasReturnOutputParameter()
hasReturnOutputParameter
in interface ParameterValueSet
public DataValueDescriptor getReturnValueForSet() throws StandardException
getReturnValueForSet
in interface ParameterValueSet
StandardException
- if a database-access error occurs.public int getScale(int parameterIndex)
getScale
in interface ParameterValueSet
parameterIndex
- the first parameter is 1, the second is 2, ...public int getPrecision(int parameterIndex)
getPrecision
in interface ParameterValueSet
parameterIndex
- the first parameter is 1, the second is 2, ...Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.