Class GenericParameter
java.lang.Object
org.apache.derby.impl.sql.GenericParameter
A parameter. Originally lifted from ParameterValueSet.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static intprivate static int(package private) StringCompile time Java class name.private final boolean(package private) boolean(package private) intCompile time JDBC type identifier.(package private) shortMode of the parameter, from ParameterMetaDataprivate final GenericParameterValueSet(package private) intWhen a decimal output parameter is registered we give it a precision(package private) intScale that has been registered.(package private) intType that has been registered.private DataValueDescriptorOur value -
Constructor Summary
ConstructorsConstructorDescriptionGenericParameter(GenericParameterValueSet pvs, boolean isReturnOutputParameter) Constructor for a Parameter -
Method Summary
Modifier and TypeMethodDescription(package private) voidclear()Clear the parameter, unless it is a return output parameterClone myself.(package private) Stringget string for param number(package private) int(package private) intgetScale()Return the scale of the parameter.(package private) DataValueDescriptorgetValue()Get the parameter value.(package private) voidinitialize(DataValueDescriptor value, int jdbcTypeId, String className) Set the DataValueDescriptor and type information for this parameter(package private) voidsetOutParameter(int sqlType, int scale) Mark the parameter as an output parameter.private StandardExceptionthrowInvalidOutParamMap(int sqlType) toString()(package private) voidvalidate()Validate the parameters.
-
Field Details
-
DECIMAL_PARAMETER_DEFAULT_PRECISION
private static int DECIMAL_PARAMETER_DEFAULT_PRECISION -
DECIMAL_PARAMETER_DEFAULT_SCALE
private static int DECIMAL_PARAMETER_DEFAULT_SCALE -
pvs
-
value
Our value -
jdbcTypeId
int jdbcTypeIdCompile time JDBC type identifier. -
declaredClassName
String declaredClassNameCompile time Java class name. -
parameterMode
short parameterModeMode of the parameter, from ParameterMetaData -
isSet
boolean isSet -
isReturnOutputParameter
private final boolean isReturnOutputParameter -
registerOutType
int registerOutTypeType that has been registered. -
registerOutScale
int registerOutScaleScale that has been registered. -
registerOutPrecision
int registerOutPrecisionWhen a decimal output parameter is registered we give it a precision
-
-
Constructor Details
-
GenericParameter
GenericParameter(GenericParameterValueSet pvs, boolean isReturnOutputParameter) Constructor for a Parameter- Parameters:
pvs- the parameter set that this is part ofisReturnOutputParameter- true if this is a return output parameter
-
-
Method Details
-
getClone
Clone myself. It is a shallow copy for everything but the underlying data wrapper and its value -- e.g. for everything but the underlying SQLInt and its int.- Parameters:
pvs- the parameter value set- Returns:
- a new generic parameter.
-
initialize
Set the DataValueDescriptor and type information for this parameter -
clear
void clear()Clear the parameter, unless it is a return output parameter -
getValue
DataValueDescriptor getValue()Get the parameter value. Doesn't check to see if it has been initialized or not.- Returns:
- the parameter value, may return null
-
setOutParameter
Mark the parameter as an output parameter.- Parameters:
sqlType- A type from java.sql.Typesscale- scale, -1 if no scale arg- Throws:
StandardException- on error
-
throwInvalidOutParamMap
-
validate
Validate the parameters. This is done for situations where we cannot validate everything in the setXXX() calls. In particular, before we do an execute() on a CallableStatement, we need to go through the parameters and make sure that all parameters are set up properly. The motivator for this is that setXXX() can be called either before or after registerOutputParamter(), we cannot be sure we have the types correct until we get to execute().- Throws:
StandardException- if the parameters aren't valid
-
getScale
int getScale()Return the scale of the parameter.- Returns:
- scale
-
getPrecision
int getPrecision() -
getJDBCParameterNumberStr
String getJDBCParameterNumberStr()get string for param number -
toString
-