|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A ParameterValueSet is a set of parameter values that can be assembled by a JDBC driver and passed to a PreparedStatement all at once. The fact that they are all passed at once can reduce the communication overhead between client and server.
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. |
void |
clearParameters()
Sets all parameters to an uninitialized state. |
ParameterValueSet |
getClone()
Clone the ParameterValueSet and its contents. |
java.lang.Object |
getObject(int parameterIndex)
Get the value of a parameter as a Java object. |
DataValueDescriptor |
getParameter(int position)
Returns the parameter 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 |
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 parameterIndex,
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()
Setthis pvs for using clause. |
void |
transferDataValues(ParameterValueSet pvstarget)
Set the parameter values of the pvstarget to equal those set in this PVS. |
void |
validate()
Validate the parameters. |
Method Detail |
public void setParameterMode(int position, int mode)
public void setStorableDataValue(DataValueDescriptor sdv, int position, int jdbcTypeId, java.lang.String className)
sdv
- 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.public void registerOutParameter(int parameterIndex, int sqlType, int scale) throws StandardException
parameterIndex
- The ordinal position 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 errorpublic 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.
parameterIndex
- The first parameter is 1, the second is 2, ...
StandardException
- if a database-access error occurs.Types
public void clearParameters()
public int getParameterCount()
public DataValueDescriptor getParameter(int position) throws StandardException
StandardException
- Thrown on errorpublic DataValueDescriptor getParameterForSet(int position) throws StandardException
StandardException
- Thrown on errorpublic void setParameterAsObject(int parameterIndex, java.lang.Object value) throws StandardException
StandardException
- Thrown on errorpublic DataValueDescriptor getParameterForGet(int position) throws StandardException
StandardException
public boolean allAreSet()
public ParameterValueSet getClone()
public void validate() throws StandardException
StandardException
- if the parameters aren't validpublic boolean hasReturnOutputParameter()
public boolean checkNoDeclaredOutputParameters()
public boolean isUsingParameterValueSet()
public void setUsingParameterValueSet()
public void transferDataValues(ParameterValueSet pvstarget) throws StandardException
pvstarget
- ParameterValueSet which will recieve the values
StandardException
- values not compatiblepublic short getParameterMode(int parameterIndex)
parameterIndex
- the first parameter is 1, the second is 2, ...public void setReturnValue(java.lang.Object value) throws StandardException
value
- the return value
StandardException
- if a database-access error occurs.public int getScale(int parameterIndex)
parameterIndex
- the first parameter is 1, the second is 2, ...
public int getPrecision(int parameterIndex)
parameterIndex
- 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 |