Top Description Fields Constructors Methods
org.springframework.jdbc.core

public Class SqlParameterValue

extends SqlParameter
Class Inheritance
Imports
org.springframework.lang.Nullable

Object to represent an 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 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.

Author
Juergen Hoeller
Since
2.0.5
See Also
java.sql.Types, JdbcTemplate#query(String, ResultSetExtractor, Object[]), JdbcTemplate#query(String, RowCallbackHandler, Object[]), JdbcTemplate#query(String, RowMapper, Object[]), JdbcTemplate#update(String, Object[])

Field Summary

Modifier and TypeField and Description
private final Object

Constructor Summary

AccessConstructor and Description
public
SqlParameterValue(int
the SQL type of the parameter according to java.sql.Types
sqlType
,
Object
the value object
value
)

Create a new SqlParameterValue, supplying the SQL type.

public
SqlParameterValue(int
the SQL type of the parameter according to java.sql.Types
sqlType
,
String
the type name of the parameter (optional)
typeName
,
Object
the value object
value
)

Create a new SqlParameterValue, supplying the SQL type.

public
SqlParameterValue(int
the SQL type of the parameter according to java.sql.Types
sqlType
,
int
the number of digits after the decimal point (for DECIMAL and NUMERIC types)
scale
,
Object
the value object
value
)

Create a new SqlParameterValue, supplying the SQL type.

public
SqlParameterValue(SqlParameter
the declared SqlParameter to define a value for
declaredParam
,
Object
the value object
value
)

Create a new SqlParameterValue based on the given SqlParameter declaration.

Method Summary

Modifier and TypeMethod and Description
public Object
getValue()

Return the value object that this parameter value holds.

Inherited from org.springframework.jdbc.core.SqlParameter:
getNamegetScalegetSqlTypegetTypeNameisInputValueProvidedisResultsParametersqlTypesToAnonymousParameterList

Field Detail

valueback to summary
private final Object value
Annotations
@Nullable

Constructor Detail

SqlParameterValueback to summary
public SqlParameterValue(int sqlType, Object value)

Create a new SqlParameterValue, supplying the SQL type.

Parameters
sqlType:int

the SQL type of the parameter according to java.sql.Types

value:Object

the value object

SqlParameterValueback to summary
public SqlParameterValue(int sqlType, String typeName, Object value)

Create a new SqlParameterValue, supplying the SQL type.

Parameters
sqlType:int

the SQL type of the parameter according to java.sql.Types

typeName:String

the type name of the parameter (optional)

value:Object

the value object

SqlParameterValueback to summary
public SqlParameterValue(int sqlType, int scale, Object value)

Create a new SqlParameterValue, supplying the SQL type.

Parameters
sqlType:int

the SQL type of the parameter according to java.sql.Types

scale:int

the number of digits after the decimal point (for DECIMAL and NUMERIC types)

value:Object

the value object

SqlParameterValueback to summary
public SqlParameterValue(SqlParameter declaredParam, Object value)

Create a new SqlParameterValue based on the given SqlParameter declaration.

Parameters
declaredParam:SqlParameter

the declared SqlParameter to define a value for

value:Object

the value object

Method Detail

getValueback to summary
public Object getValue()

Return the value object that this parameter value holds.

Annotations
@Nullable