类 SqlParameterValue
- java.lang.Object
- org.springframework.jdbc.core.SqlParameter
- org.springframework.jdbc.core.SqlParameterValue
public class SqlParameterValue extends SqlParameter
Object to represent a SQL parameter value, including parameter meta-data such as the SQL type and the scale for numeric values.Designed for use with
JdbcTemplate
's operations that take an array of argument values: Each such argument value may be aSqlParameterValue
, 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.
构造器概要
构造器 构造器 说明 SqlParameterValue(int sqlType, int scale, Object value)
Create a new SqlParameterValue, supplying the SQL type.SqlParameterValue(int sqlType, Object value)
Create a new SqlParameterValue, supplying the SQL type.SqlParameterValue(int sqlType, String typeName, Object value)
Create a new SqlParameterValue, supplying the SQL type.SqlParameterValue(SqlParameter declaredParam, Object value)
Create a new SqlParameterValue based on the given SqlParameter declaration.
方法概要
从类继承的方法 org.springframework.jdbc.core.SqlParameter
getName, getScale, getSqlType, getTypeName, isInputValueProvided, isResultsParameter, sqlTypesToAnonymousParameterList
构造器详细资料
SqlParameterValue
public SqlParameterValue(int sqlType, Object value)
Create a new SqlParameterValue, supplying the SQL type.- 参数:
sqlType
- SQL type of the parameter according tojava.sql.Types
value
- the value object
SqlParameterValue
public SqlParameterValue(int sqlType, String typeName, Object value)
Create a new SqlParameterValue, supplying the SQL type.- 参数:
sqlType
- SQL type of the parameter according tojava.sql.Types
typeName
- the type name of the parameter (optional)value
- the value object
SqlParameterValue
public SqlParameterValue(int sqlType, int scale, Object value)
Create a new SqlParameterValue, supplying the SQL type.- 参数:
sqlType
- SQL type of the parameter according tojava.sql.Types
scale
- the number of digits after the decimal point (for DECIMAL and NUMERIC types)value
- the value object
SqlParameterValue
public SqlParameterValue(SqlParameter declaredParam, Object value)
Create a new SqlParameterValue based on the given SqlParameter declaration.- 参数:
declaredParam
- the declared SqlParameter to define a value forvalue
- the value object