T
- the class of the parameter; should be compatible via cast with the
class returned by the CallableStatement.getObject(int)
method.public class OutParameter<T> extends Object
QueryRunner
, pass an instance of
OutParameter
to indicate that the parameter at that index is an
OUT parameter. The value of the parameter may be obtained from the
OutParameter
instance via getValue()
.
INOUT parameters are also supported by setting the value
of
the OutParameter
instance before invoking the stored procedure.
Constructor and Description |
---|
OutParameter(int sqlType,
Class<T> javaType)
Construct an
OutParameter for the given JDBC SQL type and
Java type. |
OutParameter(int sqlType,
Class<T> javaType,
T value)
Construct an
OutParameter for the given JDBC SQL type and
Java type and with the given value. |
Modifier and Type | Method and Description |
---|---|
Class<T> |
getJavaType()
Get the Java class for this OUT parameter.
|
int |
getSqlType()
Get the JDBC SQL type for this OUT parameter.
|
T |
getValue()
Get the value of the OUT parameter.
|
void |
setValue(T value)
Set the value of the OUT parameter.
|
String |
toString() |
public OutParameter(int sqlType, Class<T> javaType)
OutParameter
for the given JDBC SQL type and
Java type.sqlType
- the JDBC SQL type of the parameter as in
java.sql.Types
.javaType
- the Java class of the parameter value, cast compatible
with the type returned by CallableStatement.getObject(int)
for the JDBC type given by sqlType
.public OutParameter(int sqlType, Class<T> javaType, T value)
OutParameter
for the given JDBC SQL type and
Java type and with the given value. The parameter will be treated as an
INOUT parameter if the value is null.sqlType
- the JDBC SQL type of the parameter as in
java.sql.Types
.javaType
- the Java class of the parameter value, cast compatible
with the type returned by CallableStatement.getObject(int)
for the JDBC type given by sqlType
.value
- the IN value of the parameterpublic Class<T> getJavaType()
public int getSqlType()
public T getValue()
public void setValue(T value)
value
- the new value for the parameter.Copyright © 2002–2023 The Apache Software Foundation. All rights reserved.