public interface

SimpleJdbcCallOperations

org.springframework.jdbc.core.simple.SimpleJdbcCallOperations
Known Indirect Subclasses

Class Overview

Interface specifying the API for a Simple JDBC Call implemented by SimpleJdbcCall. This interface is not often used directly, but provides the option to enhance testability, as it can easily be mocked or stubbed.

Summary

Public Methods
abstract SimpleJdbcCallOperations declareParameters(SqlParameter... sqlParameters)
Specify one or more parameters if desired.
abstract Map<StringObject> execute(Object... args)
Execute the stored procedure and return a map of output params, keyed by name as in parameter declarations.
abstract Map<StringObject> execute(Map<String, ?> args)
Execute the stored procedure and return a map of output params, keyed by name as in parameter declarations..
abstract Map<StringObject> execute(SqlParameterSource args)
Execute the stored procedure and return a map of output params, keyed by name as in parameter declarations..
abstract <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.
abstract <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.
abstract <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.
abstract <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.
abstract <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.
abstract <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.
abstract SimpleJdbcCallOperations returningResultSet(String parameterName, ParameterizedRowMapper rowMapper)
abstract SimpleJdbcCallOperations returningResultSet(String parameterName, RowMapper rowMapper)
Used to specify when a ResultSet is returned by the stored procedure and you want it mapped by a RowMapper.
abstract SimpleJdbcCallOperations useInParameterNames(String... inParameterNames)
Not used yet
abstract SimpleJdbcCallOperations withCatalogName(String catalogName)
Optionally, specify the name of the catalog that contins the stored procedure.
abstract SimpleJdbcCallOperations withFunctionName(String functionName)
Specify the procedure name to be used - this implies that we will be calling a stored function.
abstract SimpleJdbcCallOperations withProcedureName(String procedureName)
Specify the procedure name to be used - this implies that we will be calling a stored procedure.
abstract SimpleJdbcCallOperations withReturnValue()
Indicates the procedure's return value should be included in the results returned.
abstract SimpleJdbcCallOperations withSchemaName(String schemaName)
Optionally, specify the name of the schema that contins the stored procedure.
abstract SimpleJdbcCallOperations withoutProcedureColumnMetaDataAccess()
Turn off any processing of parameter meta data information obtained via JDBC.

Public Methods

public abstract 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 and SqlInOutParameter will be used to provide input values. This is different from the StoredProcedure class which for backwards compatibility reasons allows input values to be provided for parameters declared as SqlOutParameter.

Parameters
sqlParameters the parameters to use
Returns
  • the instance of this SimpleJdbcCall

public abstract Map<StringObject> execute (Object... args)

Execute the stored procedure and return a map of output params, keyed by name as in parameter declarations.

Parameters
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.
Returns
  • map of output params.

public abstract Map<StringObject> execute (Map<String, ?> args)

Execute the stored procedure and return a map of output params, keyed by name as in parameter declarations..

Parameters
args Map containing the parameter values to be used in the call.
Returns
  • map of output params.

public abstract Map<StringObject> execute (SqlParameterSource args)

Execute the stored procedure and return a map of output params, keyed by name as in parameter declarations..

Parameters
args SqlParameterSource containing the parameter values to be used in the call.
Returns
  • map of output params.

public abstract T executeFunction (Class<T> returnType, SqlParameterSource args)

Execute the stored function and return the results obtained as an Object of the specified return type.

Parameters
returnType the type of the value to return
args MapSqlParameterSource containing the parameter values to be used in the call.

public abstract T executeFunction (Class<T> returnType, Object... args)

Execute the stored function and return the results obtained as an Object of the specified return type.

Parameters
returnType the type of the value to return
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.

public abstract 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.

Parameters
returnType the type of the value to return
args Map containing the parameter values to be used in the call.

public abstract 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.

Parameters
returnType the type of the value to return
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.

public abstract 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.

Parameters
returnType the type of the value to return
args MapSqlParameterSource containing the parameter values to be used in the call.

public abstract 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.

Parameters
returnType the type of the value to return
args Map containing the parameter values to be used in the call.

public abstract SimpleJdbcCallOperations returningResultSet (String parameterName, ParameterizedRowMapper rowMapper)

This method is deprecated.
in favor of returningResultSet(String, org.springframework.jdbc.core.RowMapper)

Used to specify when a ResultSet is returned by the stored procedure and you want it mapped by a RowMapper. 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.

public abstract SimpleJdbcCallOperations returningResultSet (String parameterName, RowMapper rowMapper)

Used to specify when a ResultSet is returned by the stored procedure and you want it mapped by a RowMapper. 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.

Parameters
parameterName the name of the returned results and/or the name of the ref cursor parameter
rowMapper the RowMapper implementation that will map the data returned for each row

public abstract SimpleJdbcCallOperations useInParameterNames (String... inParameterNames)

Not used yet

public abstract 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.

Parameters
catalogName the catalog or package name
Returns
  • the instance of this SimpleJdbcCall

public abstract SimpleJdbcCallOperations withFunctionName (String functionName)

Specify the procedure name to be used - this implies that we will be calling a stored function.

Parameters
functionName the name of the stored function
Returns
  • the instance of this SimpleJdbcCall

public abstract SimpleJdbcCallOperations withProcedureName (String procedureName)

Specify the procedure name to be used - this implies that we will be calling a stored procedure.

Parameters
procedureName the name of the stored procedure
Returns
  • the instance of this SimpleJdbcCall

public abstract SimpleJdbcCallOperations withReturnValue ()

Indicates the procedure's return value should be included in the results returned.

Returns
  • the instance of this SimpleJdbcCall

public abstract SimpleJdbcCallOperations withSchemaName (String schemaName)

Optionally, specify the name of the schema that contins the stored procedure.

Parameters
schemaName the name of the schema
Returns
  • the instance of this SimpleJdbcCall

public abstract SimpleJdbcCallOperations withoutProcedureColumnMetaDataAccess ()

Turn off any processing of parameter meta data information obtained via JDBC.

Returns
  • the instance of this SimpleJdbcCall