|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.derby.impl.sql.GenericParameterValueSet
Implementation of ParameterValueSet
ParameterValueSet| Field Summary | |
(package private) ClassInspector |
ci
|
private boolean |
hasReturnOutputParam
|
private boolean |
isUsingPVS
|
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)
|
java.lang.Object |
getObject(int parameterIndex)
Get the value of a parameter as a Java object. |
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)
|
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. |
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. |
boolean |
isUsingParameterValueSet()
Is this pvs for using clause. |
void |
registerOutParameter(int parameterIndex,
int sqlType,
int scale)
Mark the parameter as an output parameter. |
void |
setParameterAsObject(int position,
java.lang.Object value)
Set the value of this 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. |
void |
setReturnValue(java.lang.Object value)
Set the value of the return parameter as a Java object. |
void |
setStorableDataValue(DataValueDescriptor sdv,
int position,
int jdbcTypeId,
java.lang.String className)
Set a parameter position to a DataValueDescriptor. |
void |
setUsingParameterValueSet()
Set pvs for using clause. |
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
private boolean isUsingPVS
| 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 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
getParameterForGet in interface ParameterValueSetStandardException
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)
public void setStorableDataValue(DataValueDescriptor sdv,
int position,
int jdbcTypeId,
java.lang.String className)
ParameterValueSet
setStorableDataValue in interface ParameterValueSetsdv - The DataValueDescriptor to setposition - The parameter position to set it atjdbcTypeId - The corresponding JDBC types from java.sql.TypesclassName - The declared class name for the type.ParameterValueSet.setStorableDataValue(org.apache.derby.iapi.types.DataValueDescriptor, int, int, java.lang.String)GenericParameter getGenericParameter(int position)
public java.lang.String toString()
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 sqlType,
int scale)
throws StandardException
registerOutParameter in interface ParameterValueSetparameterIndex - The ordinal parameterIndex of a parameter to set
to the given value.sqlType - A type from java.sql.Typesscale - the scale to use. -1 means ignore scale
StandardException - on error
public java.lang.Object getObject(int parameterIndex)
throws StandardException
This method returns a Java object whose type coresponds to the SQL type that was registered for this parameter using registerOutParameter.
Note that this method may be used to read datatabase-specific, abstract data types. This is done by specifying a targetSqlType of java.sql.types.OTHER, which allows the driver to return a database-specific Java type.
getObject in interface ParameterValueSetparameterIndex - The first parameter is 1, the second is 2, ...
StandardException - if a database-access error occurs.Types
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 ParameterValueSetpublic boolean isUsingParameterValueSet()
isUsingParameterValueSet in interface ParameterValueSetpublic void setUsingParameterValueSet()
setUsingParameterValueSet in interface ParameterValueSet
public void setReturnValue(java.lang.Object value)
throws StandardException
setReturnValue in interface ParameterValueSetvalue - the return value
StandardException - 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, ...
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||