java.lang.Object | |
↳ | org.springframework.jdbc.core.simple.SimpleJdbcTemplate |
Java-5-based convenience wrapper for the classic Spring
JdbcTemplate
,
taking advantage of varargs and autoboxing, and exposing only the most
commonly required operations in order to simplify JdbcTemplate usage.
Use the getJdbcOperations()
method (or a straight JdbcTemplate)
if you need to invoke less commonly used template methods. This includes
any methods specifying SQL types, methods using less commonly used callbacks
such as RowCallbackHandler, updates with PreparedStatementSetters rather than
argument arrays, and stored procedures as well as batch operations.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new SimpleJdbcTemplate for the given DataSource.
| |||||||||||
Create a new SimpleJdbcTemplate for the given classic Spring JdbcTemplate.
| |||||||||||
Create a new SimpleJdbcTemplate for the given Spring NamedParameterJdbcTemplate.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Execute a batch using the supplied SQL statement with the batch of supplied arguments.
| |||||||||||
Execute a batch using the supplied SQL statement with the batch of supplied arguments.
| |||||||||||
Executes a batch using the supplied SQL statement with the batch of supplied arguments.
| |||||||||||
Execute a batch using the supplied SQL statement with the batch of supplied arguments.
| |||||||||||
Expose the classic Spring JdbcTemplate to allow invocation of
less commonly used methods.
| |||||||||||
Expose the Spring NamedParameterJdbcTemplate to allow invocation of
less commonly used methods.
| |||||||||||
Query for a
List of Objects of type T using
the supplied ParameterizedRowMapper to the query results to the object. | |||||||||||
Query for a
List of Objects of type T using
the supplied ParameterizedRowMapper to the query results to the object. | |||||||||||
Query for a
List of Objects of type T using
the supplied ParameterizedRowMapper to the query results to the object. | |||||||||||
Query for an
int passing in a SQL query
using the named parameter support provided by the
NamedParameterJdbcTemplate
and a SqlParameterSource containing the arguments. | |||||||||||
Query for an
int passing in a SQL query
using the named parameter support provided by the
NamedParameterJdbcTemplate
and a map containing the arguments. | |||||||||||
Query for an
int passing in a SQL query
using the standard '?' placeholders for parameters
and a variable number of arguments. | |||||||||||
Execute the supplied query with the supplied arguments.
| |||||||||||
Execute the supplied query with the supplied arguments.
| |||||||||||
Execute the supplied query with the (optional) supplied arguments.
| |||||||||||
Query for an
long passing in a SQL query
using the named parameter support provided by the
NamedParameterJdbcTemplate
and a SqlParameterSource containing the arguments. | |||||||||||
Query for an
long passing in a SQL query
using the named parameter support provided by the
NamedParameterJdbcTemplate
and a map containing the arguments. | |||||||||||
Query for an
long passing in a SQL query
using the standard '?' placeholders for parameters
and a variable number of arguments. | |||||||||||
Execute the supplied query with the (optional) supplied arguments.
| |||||||||||
Execute the supplied query with the supplied arguments.
| |||||||||||
Execute the supplied query with the supplied arguments.
| |||||||||||
Query for an object of type
T identified by the supplied @Class . | |||||||||||
Query for an object of type
T using the supplied
RowMapper to the query results to the object. | |||||||||||
Query for an object of type
T using the supplied
RowMapper to the query results to the object. | |||||||||||
Query for an object of type
T identified by the supplied @Class . | |||||||||||
Query for an object of type
T identified by the supplied @Class . | |||||||||||
Query for an object of type
T using the supplied
ParameterizedRowMapper to the query results to the object. | |||||||||||
Query for an object of type
T using the supplied
ParameterizedRowMapper to the query results to the object. | |||||||||||
Query for an object of type
T using the supplied
ParameterizedRowMapper to the query results to the object. | |||||||||||
Query for an object of type
T using the supplied
RowMapper to the query results to the object. | |||||||||||
Execute the supplied SQL statement with (optional) supplied arguments.
| |||||||||||
Execute the supplied SQL statement with supplied arguments.
| |||||||||||
Execute the supplied SQL statement with supplied arguments.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.jdbc.core.simple.SimpleJdbcOperations
|
Create a new SimpleJdbcTemplate for the given DataSource.
Creates a classic Spring JdbcTemplate and wraps it.
dataSource | the JDBC DataSource to access |
---|
Create a new SimpleJdbcTemplate for the given classic Spring JdbcTemplate.
classicJdbcTemplate | the classic Spring JdbcTemplate to wrap |
---|
Create a new SimpleJdbcTemplate for the given Spring NamedParameterJdbcTemplate.
namedParameterJdbcTemplate | the Spring NamedParameterJdbcTemplate to wrap |
---|
Execute a batch using the supplied SQL statement with the batch of supplied arguments. Uses sql with the named parameter support.
sql | the SQL statement to execute |
---|---|
batchArgs | the array of SqlParameterSource containing the batch of arguments for the query |
Execute a batch using the supplied SQL statement with the batch of supplied arguments. Uses sql with the standard '?' placeholders for parameters
sql | the SQL statement to execute. |
---|---|
batchArgs | the List of Object arrays containing the batch of arguments for the query |
argTypes | SQL types of the arguments
(constants from java.sql.Types ) |
Executes a batch using the supplied SQL statement with the batch of supplied arguments. Uses sql with the named parameter support.
sql | the SQL statement to execute |
---|---|
batchValues | the array of Maps containing the batch of arguments for the query |
Execute a batch using the supplied SQL statement with the batch of supplied arguments. Uses sql with the standard '?' placeholders for parameters
sql | the SQL statement to execute |
---|---|
batchArgs | the List of Object arrays containing the batch of arguments for the query |
Expose the classic Spring JdbcTemplate to allow invocation of less commonly used methods.
Expose the Spring NamedParameterJdbcTemplate to allow invocation of less commonly used methods.
Query for a List
of Objects
of type T
using
the supplied ParameterizedRowMapper
to the query results to the object.
Uses sql with the standard '?' placeholders for parameters
sql | the SQL query to run |
---|---|
rm | the @ParameterizedRowMapper to use for result mapping |
args | the variable number of arguments for the query |
DataAccessException |
---|
Query for a List
of Objects
of type T
using
the supplied RowMapper
to the query results to the object.
Uses sql with the named parameter support provided by the
NamedParameterJdbcTemplate
sql | the SQL query to run |
---|---|
rm | the @RowMapper to use for result mapping |
args | the SqlParameterSource containing the arguments for the query |
DataAccessException |
---|
Query for a List
of Objects
of type T
using
the supplied RowMapper
to the query results to the object.
Uses sql with the named parameter support provided by the
NamedParameterJdbcTemplate
sql | the SQL query to run |
---|---|
rm | the @RowMapper to use for result mapping |
args | the map containing the arguments for the query |
DataAccessException |
---|
Query for a List
of Objects
of type T
using
the supplied RowMapper
to the query results to the object.
Uses sql with the standard '?' placeholders for parameters
sql | the SQL query to run |
---|---|
rm | the @RowMapper to use for result mapping |
args | the variable number of arguments for the query |
DataAccessException |
---|
Query for a List
of Objects
of type T
using
the supplied ParameterizedRowMapper
to the query results to the object.
Uses sql with the named parameter support provided by the
NamedParameterJdbcTemplate
sql | the SQL query to run |
---|---|
rm | the @ParameterizedRowMapper to use for result mapping |
args | the map containing the arguments for the query |
DataAccessException |
---|
Query for a List
of Objects
of type T
using
the supplied ParameterizedRowMapper
to the query results to the object.
Uses sql with the named parameter support provided by the
NamedParameterJdbcTemplate
sql | the SQL query to run |
---|---|
rm | the @ParameterizedRowMapper to use for result mapping |
args | the SqlParameterSource containing the arguments for the query |
DataAccessException |
---|
Query for an int
passing in a SQL query
using the named parameter support provided by the
NamedParameterJdbcTemplate
and a SqlParameterSource
containing the arguments.
sql | the SQL query to run. |
---|---|
args | the SqlParameterSource containing the arguments for the query.
|
DataAccessException |
---|
Query for an int
passing in a SQL query
using the named parameter support provided by the
NamedParameterJdbcTemplate
and a map containing the arguments.
sql | the SQL query to run. |
---|---|
args | the map containing the arguments for the query |
DataAccessException |
---|
Query for an int
passing in a SQL query
using the standard '?' placeholders for parameters
and a variable number of arguments.
sql | the SQL query to run. |
---|---|
args | the variable number of arguments for the query |
DataAccessException |
---|
Execute the supplied query with the supplied arguments.
Each element in the returned List
is constructed as a Map
as described in queryForMap(String, Object...)
Uses sql with the named parameter support provided by the
NamedParameterJdbcTemplate
sql | the SQL query to run |
---|---|
args | the SqlParameterSource containing the arguments for the query |
DataAccessException |
---|
Execute the supplied query with the supplied arguments.
Each element in the returned List
is constructed as a Map
as described in queryForMap(String, Object...)
Uses sql with the named parameter support provided by the
NamedParameterJdbcTemplate
sql | the SQL query to run |
---|---|
args | the map containing the arguments for the query |
DataAccessException |
---|
Execute the supplied query with the (optional) supplied arguments.
Each element in the returned List
is constructed as a Map
as described in queryForMap(String, Object...)
Uses sql with the standard '?' placeholders for parameters
sql | the SQL query to run |
---|---|
args | the variable number of arguments for the query |
DataAccessException |
---|
Query for an long
passing in a SQL query
using the named parameter support provided by the
NamedParameterJdbcTemplate
and a SqlParameterSource
containing the arguments.
sql | the SQL query to run. |
---|---|
args | the SqlParameterSource containing the arguments for the query
|
DataAccessException |
---|
Query for an long
passing in a SQL query
using the named parameter support provided by the
NamedParameterJdbcTemplate
and a map containing the arguments.
sql | the SQL query to run. |
---|---|
args | the map containing the arguments for the query |
DataAccessException |
---|
Query for an long
passing in a SQL query
using the standard '?' placeholders for parameters
and a variable number of arguments.
sql | the SQL query to run. |
---|---|
args | the variable number of arguments for the query |
DataAccessException |
---|
Execute the supplied query with the (optional) supplied arguments.
The query is expected to be a single row query; the result row will be
mapped to a Map
sql | the SQL query to run |
---|---|
args | the variable number of arguments for the query |
DataAccessException |
---|
Execute the supplied query with the supplied arguments.
The query is expected to be a single row query; the result row will be
mapped to a MapNamedParameterJdbcTemplate
sql | the SQL query to run |
---|---|
args | the SqlParameterSource containing the arguments for the query |
DataAccessException |
---|
Execute the supplied query with the supplied arguments.
The query is expected to be a single row query; the result row will be
mapped to a MapNamedParameterJdbcTemplate
sql | the SQL query to run |
---|---|
args | the map containing the arguments for the query |
DataAccessException |
---|
Query for an object of type T
identified by the supplied @Class
.
Uses sql with the named parameter support provided by the
NamedParameterJdbcTemplate
sql | the SQL query to run |
---|---|
requiredType | the required type of the return value |
args | the map containing the arguments for the query |
DataAccessException |
---|
Query for an object of type T
using the supplied
RowMapper
to the query results to the object.
Uses sql with the standard '?' placeholders for parameters
sql | the SQL query to run |
---|---|
rm | the @RowMapper to use for result mapping |
args | the variable number of arguments for the query |
DataAccessException |
---|
Query for an object of type T
using the supplied
RowMapper
to the query results to the object.
Uses sql with the named parameter support provided by the
NamedParameterJdbcTemplate
sql | the SQL query to run |
---|---|
rm | the @RowMapper to use for result mapping |
args | the SqlParameterSource containing the arguments for the query |
DataAccessException |
---|
Query for an object of type T
identified by the supplied @Class
.
Uses sql with the standard '?' placeholders for parameters
sql | the SQL query to run |
---|---|
requiredType | the required type of the return value |
args | the variable number of arguments for the query |
DataAccessException |
---|
Query for an object of type T
identified by the supplied @Class
.
Uses sql with the named parameter support provided by the
NamedParameterJdbcTemplate
sql | the SQL query to run |
---|---|
requiredType | the required type of the return value |
args | the SqlParameterSource containing the arguments for the query |
DataAccessException |
---|
Query for an object of type T
using the supplied
ParameterizedRowMapper
to the query results to the object.
Uses sql with the named parameter support provided by the
NamedParameterJdbcTemplate
sql | the SQL query to run |
---|---|
rm | the @ParameterizedRowMapper to use for result mapping |
args | the SqlParameterSource containing the arguments for the query |
DataAccessException |
---|
Query for an object of type T
using the supplied
ParameterizedRowMapper
to the query results to the object.
Uses sql with the standard '?' placeholders for parameters
sql | the SQL query to run |
---|---|
rm | the @ParameterizedRowMapper to use for result mapping |
args | the variable number of arguments for the query |
DataAccessException |
---|
Query for an object of type T
using the supplied
ParameterizedRowMapper
to the query results to the object.
Uses sql with the named parameter support provided by the
NamedParameterJdbcTemplate
sql | the SQL query to run |
---|---|
rm | the @ParameterizedRowMapper to use for result mapping |
args | the map containing the arguments for the query |
DataAccessException |
---|
Query for an object of type T
using the supplied
RowMapper
to the query results to the object.
Uses sql with the named parameter support provided by the
NamedParameterJdbcTemplate
sql | the SQL query to run |
---|---|
rm | the @RowMapper to use for result mapping |
args | the map containing the arguments for the query |
DataAccessException |
---|
Execute the supplied SQL statement with (optional) supplied arguments.
Uses sql with the named parameter support provided by the
NamedParameterJdbcTemplate
sql | the SQL statement to execute |
---|---|
args | the map containing the arguments for the query |
DataAccessException |
---|
Execute the supplied SQL statement with supplied arguments. Uses sql with the standard '?' placeholders for parameters
sql | the SQL statement to execute |
---|---|
args | the variable number of arguments for the query |
DataAccessException |
---|
Execute the supplied SQL statement with supplied arguments.
Uses sql with the named parameter support provided by the
NamedParameterJdbcTemplate
sql | the SQL statement to execute |
---|---|
args | the SqlParameterSource containing the arguments for the statement |
DataAccessException |
---|