接口 SimpleJdbcCallOperations
- 所有已知实现类:
SimpleJdbcCall
public interface SimpleJdbcCallOperations
Interface specifying the API for a Simple JDBC Call implemented bySimpleJdbcCall
. This interface is not often used directly, but provides the option to enhance testability, as it can easily be mocked or stubbed.- 从以下版本开始:
- 2.5
- 作者:
- Thomas Risberg, Stephane Nicoll
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 SimpleJdbcCallOperations
declareParameters(SqlParameter... sqlParameters)
Specify one or more parameters if desired.Map<String,Object>
execute(Object... args)
Execute the stored procedure and return a map of output params, keyed by name as in parameter declarations.Map<String,Object>
execute(Map<String,?> args)
Execute the stored procedure and return a map of output params, keyed by name as in parameter declarations.Map<String,Object>
execute(SqlParameterSource args)
Execute the stored procedure and return a map of output params, keyed by name as in parameter declarations.<T> T
executeFunction(Class<T> returnType, Object... args)
Execute the stored function and return the results obtained as an Object of the specified return type.<T> T
executeFunction(Class<T> returnType, Map<String,?> args)
Execute the stored function and return the results obtained as an Object of the specified return type.<T> T
executeFunction(Class<T> returnType, SqlParameterSource args)
Execute the stored function and return the results obtained as an Object of the specified return type.<T> T
executeObject(Class<T> returnType, Object... args)
Execute the stored procedure and return the single out parameter as an Object of the specified return type.<T> T
executeObject(Class<T> returnType, Map<String,?> args)
Execute the stored procedure and return the single out parameter as an Object of the specified return type.<T> T
executeObject(Class<T> returnType, SqlParameterSource args)
Execute the stored procedure and return the single out parameter as an Object of the specified return type.SimpleJdbcCallOperations
returningResultSet(String parameterName, RowMapper<?> rowMapper)
Used to specify when a ResultSet is returned by the stored procedure and you want it mapped by aRowMapper
.SimpleJdbcCallOperations
useInParameterNames(String... inParameterNames)
Not used yetSimpleJdbcCallOperations
withCatalogName(String catalogName)
Optionally, specify the name of the catalog that contins the stored procedure.SimpleJdbcCallOperations
withFunctionName(String functionName)
Specify the procedure name to be used - this implies that we will be calling a stored function.SimpleJdbcCallOperations
withNamedBinding()
Indicates that parameters should be bound by name.SimpleJdbcCallOperations
withoutProcedureColumnMetaDataAccess()
Turn off any processing of parameter meta-data information obtained via JDBC.SimpleJdbcCallOperations
withProcedureName(String procedureName)
Specify the procedure name to be used - this implies that we will be calling a stored procedure.SimpleJdbcCallOperations
withReturnValue()
Indicates the procedure's return value should be included in the results returned.SimpleJdbcCallOperations
withSchemaName(String schemaName)
Optionally, specify the name of the schema that contins the stored procedure.
方法详细资料
withProcedureName
SimpleJdbcCallOperations withProcedureName(String procedureName)
Specify the procedure name to be used - this implies that we will be calling a stored procedure.- 参数:
procedureName
- the name of the stored procedure- 返回:
- the instance of this SimpleJdbcCall
withFunctionName
SimpleJdbcCallOperations withFunctionName(String functionName)
Specify the procedure name to be used - this implies that we will be calling a stored function.- 参数:
functionName
- the name of the stored function- 返回:
- the instance of this SimpleJdbcCall
withSchemaName
SimpleJdbcCallOperations withSchemaName(String schemaName)
Optionally, specify the name of the schema that contins the stored procedure.- 参数:
schemaName
- the name of the schema- 返回:
- the instance of this SimpleJdbcCall
withCatalogName
SimpleJdbcCallOperations withCatalogName(String catalogName)
Optionally, specify the name of the catalog that contins the stored procedure.To provide consistency with the Oracle DatabaseMetaData, this is used to specify the package name if the procedure is declared as part of a package.
- 参数:
catalogName
- the catalog or package name- 返回:
- the instance of this SimpleJdbcCall
withReturnValue
SimpleJdbcCallOperations withReturnValue()
Indicates the procedure's return value should be included in the results returned.- 返回:
- the instance of this SimpleJdbcCall
declareParameters
SimpleJdbcCallOperations declareParameters(SqlParameter... sqlParameters)
Specify one or more parameters if desired. These parameters will be supplemented with any parameter information retrieved from the database meta-data.Note that only parameters declared as
SqlParameter
andSqlInOutParameter
will be used to provide input values. This is different from theStoredProcedure
class which - for backwards compatibility reasons - allows input values to be provided for parameters declared asSqlOutParameter
.- 参数:
sqlParameters
- the parameters to use- 返回:
- the instance of this SimpleJdbcCall
useInParameterNames
SimpleJdbcCallOperations useInParameterNames(String... inParameterNames)
Not used yet
returningResultSet
SimpleJdbcCallOperations returningResultSet(String parameterName, RowMapper<?> rowMapper)
Used to specify when a ResultSet is returned by the stored procedure and you want it mapped by aRowMapper
. The results will be returned using the parameter name specified. Multiple ResultSets must be declared in the correct order.If the database you are using uses ref cursors then the name specified must match the name of the parameter declared for the procedure in the database.
- 参数:
parameterName
- the name of the returned results and/or the name of the ref cursor parameterrowMapper
- the RowMapper implementation that will map the data returned for each row
withoutProcedureColumnMetaDataAccess
SimpleJdbcCallOperations withoutProcedureColumnMetaDataAccess()
Turn off any processing of parameter meta-data information obtained via JDBC.- 返回:
- the instance of this SimpleJdbcCall
withNamedBinding
SimpleJdbcCallOperations withNamedBinding()
Indicates that parameters should be bound by name.- 返回:
- the instance of this SimpleJdbcCall
- 从以下版本开始:
- 4.2
executeFunction
<T> T executeFunction(Class<T> returnType, Object... args)
Execute the stored function and return the results obtained as an Object of the specified return type.- 参数:
returnType
- the type of the value to returnargs
- optional array containing the in parameter values to be used in the call. Parameter values must be provided in the same order as the parameters are defined for the stored procedure.
executeFunction
<T> T executeFunction(Class<T> returnType, Map<String,?> args)
Execute the stored function and return the results obtained as an Object of the specified return type.- 参数:
returnType
- the type of the value to returnargs
- Map containing the parameter values to be used in the call
executeFunction
<T> T executeFunction(Class<T> returnType, SqlParameterSource args)
Execute the stored function and return the results obtained as an Object of the specified return type.- 参数:
returnType
- the type of the value to returnargs
- MapSqlParameterSource containing the parameter values to be used in the call
executeObject
<T> T executeObject(Class<T> returnType, Object... args)
Execute the stored procedure and return the single out parameter as an Object of the specified return type. In the case where there are multiple out parameters, the first one is returned and additional out parameters are ignored.- 参数:
returnType
- the type of the value to returnargs
- optional array containing the in parameter values to be used in the call. Parameter values must be provided in the same order as the parameters are defined for the stored procedure.
executeObject
<T> T executeObject(Class<T> returnType, Map<String,?> args)
Execute the stored procedure and return the single out parameter as an Object of the specified return type. In the case where there are multiple out parameters, the first one is returned and additional out parameters are ignored.- 参数:
returnType
- the type of the value to returnargs
- Map containing the parameter values to be used in the call
executeObject
<T> T executeObject(Class<T> returnType, SqlParameterSource args)
Execute the stored procedure and return the single out parameter as an Object of the specified return type. In the case where there are multiple out parameters, the first one is returned and additional out parameters are ignored.- 参数:
returnType
- the type of the value to returnargs
- MapSqlParameterSource containing the parameter values to be used in the call
execute
Map<String,Object> execute(Object... args)
Execute the stored procedure and return a map of output params, keyed by name as in parameter declarations.- 参数:
args
- optional array containing the in parameter values to be used in the call. Parameter values must be provided in the same order as the parameters are defined for the stored procedure.- 返回:
- Map of output params
execute
Map<String,Object> execute(Map<String,?> args)
Execute the stored procedure and return a map of output params, keyed by name as in parameter declarations.- 参数:
args
- Map containing the parameter values to be used in the call- 返回:
- Map of output params
execute
Map<String,Object> execute(SqlParameterSource args)
Execute the stored procedure and return a map of output params, keyed by name as in parameter declarations.- 参数:
args
- SqlParameterSource containing the parameter values to be used in the call- 返回:
- Map of output params