public class

SqlParameter

extends Object
java.lang.Object
   ↳ org.springframework.jdbc.core.SqlParameter
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Object to represent a SQL parameter definition.

Parameters may be anonymous, in which case "name" is null. However, all parameters must define a SQL type according to java.sql.Types.

See Also
  • java.sql.Types

Summary

Public Constructors
SqlParameter(int sqlType)
Create a new anonymous SqlParameter, supplying the SQL type.
SqlParameter(int sqlType, String typeName)
Create a new anonymous SqlParameter, supplying the SQL type.
SqlParameter(int sqlType, int scale)
Create a new anonymous SqlParameter, supplying the SQL type.
SqlParameter(String name, int sqlType)
Create a new SqlParameter, supplying name and SQL type.
SqlParameter(String name, int sqlType, String typeName)
Create a new SqlParameter, supplying name and SQL type.
SqlParameter(String name, int sqlType, int scale)
Create a new SqlParameter, supplying name and SQL type.
SqlParameter(SqlParameter otherParam)
Copy constructor.
Public Methods
String getName()
Return the name of the parameter.
Integer getScale()
Return the scale of the parameter, if any.
int getSqlType()
Return the SQL type of the parameter.
String getTypeName()
Return the type name of the parameter, if any.
boolean isInputValueProvided()
Return whether this parameter holds input values that should be set before execution even if they are null.
boolean isResultsParameter()
Return whether this parameter is an implicit return parameter used during the results preocessing of the CallableStatement.getMoreResults/getUpdateCount.
static List<SqlParameter> sqlTypesToAnonymousParameterList(int[] types)
Convert a list of JDBC types, as defined in java.sql.Types, to a List of SqlParameter objects as used in this package.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public SqlParameter (int sqlType)

Create a new anonymous SqlParameter, supplying the SQL type.

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

public SqlParameter (int sqlType, String typeName)

Create a new anonymous SqlParameter, supplying the SQL type.

Parameters
sqlType SQL type of the parameter according to java.sql.Types
typeName the type name of the parameter (optional)

public SqlParameter (int sqlType, int scale)

Create a new anonymous SqlParameter, supplying the SQL type.

Parameters
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)

public SqlParameter (String name, int sqlType)

Create a new SqlParameter, supplying name and SQL type.

Parameters
name name of the parameter, as used in input and output maps
sqlType SQL type of the parameter according to java.sql.Types

public SqlParameter (String name, int sqlType, String typeName)

Create a new SqlParameter, supplying name and SQL type.

Parameters
name name of the parameter, as used in input and output maps
sqlType SQL type of the parameter according to java.sql.Types
typeName the type name of the parameter (optional)

public SqlParameter (String name, int sqlType, int scale)

Create a new SqlParameter, supplying name and SQL type.

Parameters
name name of the parameter, as used in input and output maps
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)

public SqlParameter (SqlParameter otherParam)

Copy constructor.

Parameters
otherParam the SqlParameter object to copy from

Public Methods

public String getName ()

Return the name of the parameter.

public Integer getScale ()

Return the scale of the parameter, if any.

public int getSqlType ()

Return the SQL type of the parameter.

public String getTypeName ()

Return the type name of the parameter, if any.

public boolean isInputValueProvided ()

Return whether this parameter holds input values that should be set before execution even if they are null.

This implementation always returns true.

public boolean isResultsParameter ()

Return whether this parameter is an implicit return parameter used during the results preocessing of the CallableStatement.getMoreResults/getUpdateCount.

This implementation always returns false.

public static List<SqlParameter> sqlTypesToAnonymousParameterList (int[] types)

Convert a list of JDBC types, as defined in java.sql.Types, to a List of SqlParameter objects as used in this package.