public class SqlParameterValue extends SqlParameter
Designed for use with JdbcTemplate
's operations that take an array of
argument values: Each such argument value may be a SqlParameterValue
,
indicating the SQL type (and optionally the scale) instead of letting the
template guess a default type. Note that this only applies to the operations with
a 'plain' argument array, not to the overloaded variants with an explicit type array.
Types
,
JdbcTemplate.query(String, Object[], ResultSetExtractor)
,
JdbcTemplate.query(String, Object[], RowCallbackHandler)
,
JdbcTemplate.query(String, Object[], RowMapper)
,
JdbcTemplate.update(String, Object[])
Modifier and Type | Field and Description |
---|---|
private java.lang.Object |
value |
Constructor and Description |
---|
SqlParameterValue(int sqlType,
int scale,
java.lang.Object value)
Create a new SqlParameterValue, supplying the SQL type.
|
SqlParameterValue(int sqlType,
java.lang.Object value)
Create a new SqlParameterValue, supplying the SQL type.
|
SqlParameterValue(int sqlType,
java.lang.String typeName,
java.lang.Object value)
Create a new SqlParameterValue, supplying the SQL type.
|
SqlParameterValue(SqlParameter declaredParam,
java.lang.Object value)
Create a new SqlParameterValue based on the given SqlParameter declaration.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getValue()
Return the value object that this parameter value holds.
|
getName, getScale, getSqlType, getTypeName, isInputValueProvided, isResultsParameter, sqlTypesToAnonymousParameterList
public SqlParameterValue(int sqlType, java.lang.Object value)
sqlType
- SQL type of the parameter according to java.sql.Types
value
- the value objectpublic SqlParameterValue(int sqlType, java.lang.String typeName, java.lang.Object value)
sqlType
- SQL type of the parameter according to java.sql.Types
typeName
- the type name of the parameter (optional)value
- the value objectpublic SqlParameterValue(int sqlType, int scale, java.lang.Object value)
sqlType
- SQL type of the parameter according to java.sql.Types
scale
- the number of digits after the decimal point
(for DECIMAL and NUMERIC types)value
- the value objectpublic SqlParameterValue(SqlParameter declaredParam, java.lang.Object value)
declaredParam
- the declared SqlParameter to define a value forvalue
- the value object