站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 1.2.9 API 文档英文版

SqlParameter (Spring Framework) - Spring Framework 1.2.9 API 文档英文版


org.springframework.jdbc.core
Class SqlParameter

java.lang.Object
  extended by org.springframework.jdbc.core.SqlParameter
Direct Known Subclasses:
ResultSetSupportingSqlParameter

public class SqlParameter
extends Object

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 Types.

Author:
Rod Johnson, Thomas Risberg
See Also:
Types

Constructor Summary
SqlParameter(int sqlType)
          Create a new anonymous SqlParameter, supplying SQL type.
SqlParameter(int sqlType, String typeName)
          Create a new anonymous SqlParameter, supplying 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.
 
Method Summary
 String getName()
          Return the name of the parameter.
 int getSqlType()
          Return the SQL type of the parameter.
 String getTypeName()
          Return the type name of the parameter, if any.
static List 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SqlParameter

public SqlParameter(int sqlType)
Create a new anonymous SqlParameter, supplying SQL type.

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

SqlParameter

public SqlParameter(int sqlType,
                    String typeName)
Create a new anonymous SqlParameter, supplying SQL type.

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

SqlParameter

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

SqlParameter

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)
Method Detail

getName

public String getName()
Return the name of the parameter.


getSqlType

public int getSqlType()
Return the SQL type of the parameter.


getTypeName

public String getTypeName()
Return the type name of the parameter, if any.


sqlTypesToAnonymousParameterList

public static List 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.



Copyright (c) 2002-2007 The Spring Framework Project.