|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.derby.impl.sql.GenericParameterValueSet
final class GenericParameterValueSet
Implementation of ParameterValueSet
ParameterValueSet| Field Summary | |
|---|---|
(package private) ClassInspector |
ci
|
private boolean |
hasReturnOutputParam
|
private GenericParameter[] |
parms
|
| Constructor Summary | |
|---|---|
(package private) |
GenericParameterValueSet(ClassInspector ci,
int numParms,
boolean hasReturnOutputParam)
Constructor for a GenericParameterValueSet |
private |
GenericParameterValueSet(int numParms,
GenericParameterValueSet pvs)
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private final GenericParameter[] parms
final ClassInspector ci
private final boolean hasReturnOutputParam
| Constructor Detail |
|---|
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)
| Method Detail |
|---|
public void initialize(DataTypeDescriptor[] types)
throws StandardException
initialize in interface ParameterValueSettypes - expected to match the number of parameters.
StandardException
public void setParameterMode(int position,
int mode)
ParameterValueSet
setParameterMode in interface ParameterValueSetpublic void clearParameters()
ParameterValueSet
clearParameters in interface ParameterValueSetParameterValueSet.clearParameters()public int getParameterCount()
getParameterCount in interface ParameterValueSet
public DataValueDescriptor getParameter(int position)
throws StandardException
getParameter in interface ParameterValueSetStandardException - Thrown on error
public DataValueDescriptor getParameterForSet(int position)
throws StandardException
ParameterValueSet
getParameterForSet in interface ParameterValueSetStandardException - Thrown on error
public DataValueDescriptor getParameterForGet(int position)
throws StandardException
ParameterValueSet
getParameterForGet in interface ParameterValueSetposition - 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 ParameterValueSetStandardException - Thrown on errorpublic boolean allAreSet()
ParameterValueSet
allAreSet in interface ParameterValueSetParameterValueSet.allAreSet()
public void transferDataValues(ParameterValueSet pvstarget)
throws StandardException
ParameterValueSet
transferDataValues in interface ParameterValueSetpvstarget - ParameterValueSet which will recieve the values
StandardException - 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 check
StandardException - 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 ParameterValueSetparameterIndex - 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 scale
StandardException - on error
public void validate()
throws StandardException
validate in interface ParameterValueSetStandardException - if the parameters aren't validpublic int getParameterNumber(GenericParameter theParam)
public boolean checkNoDeclaredOutputParameters()
checkNoDeclaredOutputParameters in interface ParameterValueSetpublic short getParameterMode(int parameterIndex)
getParameterMode in interface ParameterValueSetparameterIndex - the first parameter is 1, the second is 2, ...public boolean hasReturnOutputParameter()
hasReturnOutputParameter in interface ParameterValueSet
public DataValueDescriptor getReturnValueForSet()
throws StandardException
getReturnValueForSet in interface ParameterValueSetStandardException - if a database-access error occurs.public int getScale(int parameterIndex)
getScale in interface ParameterValueSetparameterIndex - the first parameter is 1, the second is 2, ...
public int getPrecision(int parameterIndex)
getPrecision in interface ParameterValueSetparameterIndex - the first parameter is 1, the second is 2, ...
|
Built on Wed 2013-06-12 15:21:56+0000, from revision ??? | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||