JdbcTemplate
and
NamedParameterJdbcTemplate
. The JdbcTemplate and
NamedParameterJdbcTemplate now provide all the functionality of the SimpleJdbcTemplate.@Deprecated public class SimpleJdbcTemplate extends java.lang.Object implements SimpleJdbcOperations
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.
ParameterizedRowMapper
,
SimpleJdbcDaoSupport
,
JdbcTemplate
Modifier and Type | Field and Description |
---|---|
private NamedParameterJdbcOperations |
namedParameterJdbcOperations
Deprecated.
The NamedParameterJdbcTemplate that we are wrapping
|
Constructor and Description |
---|
SimpleJdbcTemplate(javax.sql.DataSource dataSource)
Deprecated.
Create a new SimpleJdbcTemplate for the given DataSource.
|
SimpleJdbcTemplate(JdbcOperations classicJdbcTemplate)
Deprecated.
Create a new SimpleJdbcTemplate for the given classic Spring JdbcTemplate.
|
SimpleJdbcTemplate(NamedParameterJdbcOperations namedParameterJdbcTemplate)
Deprecated.
Create a new SimpleJdbcTemplate for the given Spring NamedParameterJdbcTemplate.
|
Modifier and Type | Method and Description |
---|---|
int[] |
batchUpdate(java.lang.String sql,
java.util.List<java.lang.Object[]> batchArgs)
Deprecated.
Execute a batch using the supplied SQL statement with the batch of supplied arguments.
|
int[] |
batchUpdate(java.lang.String sql,
java.util.List<java.lang.Object[]> batchArgs,
int[] argTypes)
Deprecated.
Execute a batch using the supplied SQL statement with the batch of supplied arguments.
|
int[] |
batchUpdate(java.lang.String sql,
java.util.Map<java.lang.String,?>[] batchValues)
Deprecated.
Executes a batch using the supplied SQL statement with the batch of supplied arguments.
|
int[] |
batchUpdate(java.lang.String sql,
SqlParameterSource[] batchArgs)
Deprecated.
Execute a batch using the supplied SQL statement with the batch of supplied arguments.
|
private java.lang.Object[] |
getArguments(java.lang.Object[] varArgs)
Deprecated.
|
JdbcOperations |
getJdbcOperations()
Deprecated.
Expose the classic Spring JdbcTemplate to allow invocation of
less commonly used methods.
|
NamedParameterJdbcOperations |
getNamedParameterJdbcOperations()
Deprecated.
Expose the Spring NamedParameterJdbcTemplate to allow invocation of
less commonly used methods.
|
<T> java.util.List<T> |
query(java.lang.String sql,
ParameterizedRowMapper<T> rm,
java.util.Map<java.lang.String,?> args)
Deprecated.
|
<T> java.util.List<T> |
query(java.lang.String sql,
ParameterizedRowMapper<T> rm,
java.lang.Object... args)
Deprecated.
|
<T> java.util.List<T> |
query(java.lang.String sql,
ParameterizedRowMapper<T> rm,
SqlParameterSource args)
Deprecated.
|
<T> java.util.List<T> |
query(java.lang.String sql,
RowMapper<T> rm,
java.util.Map<java.lang.String,?> args)
Deprecated.
Query for a
List of Objects of type T using
the supplied RowMapper to the query results to the object. |
<T> java.util.List<T> |
query(java.lang.String sql,
RowMapper<T> rm,
java.lang.Object... args)
Deprecated.
Query for a
List of Objects of type T using
the supplied RowMapper to the query results to the object. |
<T> java.util.List<T> |
query(java.lang.String sql,
RowMapper<T> rm,
SqlParameterSource args)
Deprecated.
Query for a
List of Objects of type T using
the supplied RowMapper to the query results to the object. |
int |
queryForInt(java.lang.String sql,
java.util.Map<java.lang.String,?> args)
Deprecated.
Query for an
int passing in a SQL query
using the named parameter support provided by the
NamedParameterJdbcTemplate
and a map containing the arguments. |
int |
queryForInt(java.lang.String sql,
java.lang.Object... args)
Deprecated.
Query for an
int passing in a SQL query
using the standard '?' placeholders for parameters
and a variable number of arguments. |
int |
queryForInt(java.lang.String sql,
SqlParameterSource args)
Deprecated.
Query for an
int passing in a SQL query
using the named parameter support provided by the
NamedParameterJdbcTemplate
and a SqlParameterSource containing the arguments. |
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
queryForList(java.lang.String sql,
java.util.Map<java.lang.String,?> args)
Deprecated.
Execute the supplied query with the supplied arguments.
|
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
queryForList(java.lang.String sql,
java.lang.Object... args)
Deprecated.
Execute the supplied query with the (optional) supplied arguments.
|
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
queryForList(java.lang.String sql,
SqlParameterSource args)
Deprecated.
Execute the supplied query with the supplied arguments.
|
long |
queryForLong(java.lang.String sql,
java.util.Map<java.lang.String,?> args)
Deprecated.
Query for an
long passing in a SQL query
using the named parameter support provided by the
NamedParameterJdbcTemplate
and a map containing the arguments. |
long |
queryForLong(java.lang.String sql,
java.lang.Object... args)
Deprecated.
Query for an
long passing in a SQL query
using the standard '?' placeholders for parameters
and a variable number of arguments. |
long |
queryForLong(java.lang.String sql,
SqlParameterSource args)
Deprecated.
Query for an
long passing in a SQL query
using the named parameter support provided by the
NamedParameterJdbcTemplate
and a SqlParameterSource containing the arguments. |
java.util.Map<java.lang.String,java.lang.Object> |
queryForMap(java.lang.String sql,
java.util.Map<java.lang.String,?> args)
Deprecated.
Execute the supplied query with the supplied arguments.
|
java.util.Map<java.lang.String,java.lang.Object> |
queryForMap(java.lang.String sql,
java.lang.Object... args)
Deprecated.
Execute the supplied query with the (optional) supplied arguments.
|
java.util.Map<java.lang.String,java.lang.Object> |
queryForMap(java.lang.String sql,
SqlParameterSource args)
Deprecated.
Execute the supplied query with the supplied arguments.
|
<T> T |
queryForObject(java.lang.String sql,
java.lang.Class<T> requiredType,
java.util.Map<java.lang.String,?> args)
Deprecated.
Query for an object of type
T identified by the supplied @Class . |
<T> T |
queryForObject(java.lang.String sql,
java.lang.Class<T> requiredType,
java.lang.Object... args)
Deprecated.
Query for an object of type
T identified by the supplied @Class . |
<T> T |
queryForObject(java.lang.String sql,
java.lang.Class<T> requiredType,
SqlParameterSource args)
Deprecated.
Query for an object of type
T identified by the supplied @Class . |
<T> T |
queryForObject(java.lang.String sql,
ParameterizedRowMapper<T> rm,
java.util.Map<java.lang.String,?> args)
Deprecated.
|
<T> T |
queryForObject(java.lang.String sql,
ParameterizedRowMapper<T> rm,
java.lang.Object... args)
Deprecated.
|
<T> T |
queryForObject(java.lang.String sql,
ParameterizedRowMapper<T> rm,
SqlParameterSource args)
Deprecated.
|
<T> T |
queryForObject(java.lang.String sql,
RowMapper<T> rm,
java.util.Map<java.lang.String,?> args)
Deprecated.
Query for an object of type
T using the supplied
RowMapper to the query results to the object. |
<T> T |
queryForObject(java.lang.String sql,
RowMapper<T> rm,
java.lang.Object... args)
Deprecated.
Query for an object of type
T using the supplied
RowMapper to the query results to the object. |
<T> T |
queryForObject(java.lang.String sql,
RowMapper<T> rm,
SqlParameterSource args)
Deprecated.
Query for an object of type
T using the supplied
RowMapper to the query results to the object. |
int |
update(java.lang.String sql,
java.util.Map<java.lang.String,?> args)
Deprecated.
Execute the supplied SQL statement with (optional) supplied arguments.
|
int |
update(java.lang.String sql,
java.lang.Object... args)
Deprecated.
Execute the supplied SQL statement with supplied arguments.
|
int |
update(java.lang.String sql,
SqlParameterSource args)
Deprecated.
Execute the supplied SQL statement with supplied arguments.
|
private final NamedParameterJdbcOperations namedParameterJdbcOperations
public SimpleJdbcTemplate(javax.sql.DataSource dataSource)
Creates a classic Spring JdbcTemplate and wraps it.
dataSource
- the JDBC DataSource to accesspublic SimpleJdbcTemplate(JdbcOperations classicJdbcTemplate)
classicJdbcTemplate
- the classic Spring JdbcTemplate to wrappublic SimpleJdbcTemplate(NamedParameterJdbcOperations namedParameterJdbcTemplate)
namedParameterJdbcTemplate
- the Spring NamedParameterJdbcTemplate to wrappublic JdbcOperations getJdbcOperations()
getJdbcOperations
in interface SimpleJdbcOperations
public NamedParameterJdbcOperations getNamedParameterJdbcOperations()
getNamedParameterJdbcOperations
in interface SimpleJdbcOperations
public int queryForInt(java.lang.String sql, java.util.Map<java.lang.String,?> args) throws DataAccessException
SimpleJdbcOperations
int
passing in a SQL query
using the named parameter support provided by the
NamedParameterJdbcTemplate
and a map containing the arguments.queryForInt
in interface SimpleJdbcOperations
sql
- the SQL query to run.args
- the map containing the arguments for the queryDataAccessException
public int queryForInt(java.lang.String sql, SqlParameterSource args) throws DataAccessException
SimpleJdbcOperations
int
passing in a SQL query
using the named parameter support provided by the
NamedParameterJdbcTemplate
and a SqlParameterSource
containing the arguments.queryForInt
in interface SimpleJdbcOperations
sql
- the SQL query to run.args
- the SqlParameterSource
containing the arguments for the query.DataAccessException
public int queryForInt(java.lang.String sql, java.lang.Object... args) throws DataAccessException
SimpleJdbcOperations
int
passing in a SQL query
using the standard '?' placeholders for parameters
and a variable number of arguments.queryForInt
in interface SimpleJdbcOperations
sql
- the SQL query to run.args
- the variable number of arguments for the queryDataAccessException
public long queryForLong(java.lang.String sql, java.util.Map<java.lang.String,?> args) throws DataAccessException
SimpleJdbcOperations
long
passing in a SQL query
using the named parameter support provided by the
NamedParameterJdbcTemplate
and a map containing the arguments.queryForLong
in interface SimpleJdbcOperations
sql
- the SQL query to run.args
- the map containing the arguments for the queryDataAccessException
public long queryForLong(java.lang.String sql, SqlParameterSource args) throws DataAccessException
SimpleJdbcOperations
long
passing in a SQL query
using the named parameter support provided by the
NamedParameterJdbcTemplate
and a SqlParameterSource
containing the arguments.queryForLong
in interface SimpleJdbcOperations
sql
- the SQL query to run.args
- the SqlParameterSource
containing the arguments for the queryDataAccessException
public long queryForLong(java.lang.String sql, java.lang.Object... args) throws DataAccessException
SimpleJdbcOperations
long
passing in a SQL query
using the standard '?' placeholders for parameters
and a variable number of arguments.queryForLong
in interface SimpleJdbcOperations
sql
- the SQL query to run.args
- the variable number of arguments for the queryDataAccessException
public <T> T queryForObject(java.lang.String sql, java.lang.Class<T> requiredType, java.util.Map<java.lang.String,?> args) throws DataAccessException
SimpleJdbcOperations
T
identified by the supplied @Class
.
Uses sql with the named parameter support provided by the
NamedParameterJdbcTemplate
queryForObject
in interface SimpleJdbcOperations
sql
- the SQL query to runrequiredType
- the required type of the return valueargs
- the map containing the arguments for the queryDataAccessException
JdbcOperations.queryForObject(String, Class)
,
JdbcOperations.queryForObject(String, Object[], Class)
public <T> T queryForObject(java.lang.String sql, java.lang.Class<T> requiredType, SqlParameterSource args) throws DataAccessException
SimpleJdbcOperations
T
identified by the supplied @Class
.
Uses sql with the named parameter support provided by the
NamedParameterJdbcTemplate
queryForObject
in interface SimpleJdbcOperations
sql
- the SQL query to runrequiredType
- the required type of the return valueargs
- the SqlParameterSource
containing the arguments for the queryDataAccessException
JdbcOperations.queryForObject(String, Class)
,
JdbcOperations.queryForObject(String, Object[], Class)
public <T> T queryForObject(java.lang.String sql, java.lang.Class<T> requiredType, java.lang.Object... args) throws DataAccessException
SimpleJdbcOperations
T
identified by the supplied @Class
.
Uses sql with the standard '?' placeholders for parametersqueryForObject
in interface SimpleJdbcOperations
sql
- the SQL query to runrequiredType
- the required type of the return valueargs
- the variable number of arguments for the queryDataAccessException
JdbcOperations.queryForObject(String, Class)
,
JdbcOperations.queryForObject(String, Object[], Class)
public <T> T queryForObject(java.lang.String sql, RowMapper<T> rm, java.util.Map<java.lang.String,?> args) throws DataAccessException
SimpleJdbcOperations
T
using the supplied
RowMapper
to the query results to the object.
Uses sql with the named parameter support provided by the
NamedParameterJdbcTemplate
queryForObject
in interface SimpleJdbcOperations
sql
- the SQL query to runrm
- the @RowMapper
to use for result mappingargs
- the map containing the arguments for the queryDataAccessException
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper)
,
JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)
@Deprecated public <T> T queryForObject(java.lang.String sql, ParameterizedRowMapper<T> rm, java.util.Map<java.lang.String,?> args) throws DataAccessException
SimpleJdbcOperations
T
using the supplied
ParameterizedRowMapper
to the query results to the object.
Uses sql with the named parameter support provided by the
NamedParameterJdbcTemplate
queryForObject
in interface SimpleJdbcOperations
sql
- the SQL query to runrm
- the @ParameterizedRowMapper
to use for result mappingargs
- the map containing the arguments for the queryDataAccessException
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper)
,
JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)
public <T> T queryForObject(java.lang.String sql, RowMapper<T> rm, SqlParameterSource args) throws DataAccessException
SimpleJdbcOperations
T
using the supplied
RowMapper
to the query results to the object.
Uses sql with the named parameter support provided by the
NamedParameterJdbcTemplate
queryForObject
in interface SimpleJdbcOperations
sql
- the SQL query to runrm
- the @RowMapper
to use for result mappingargs
- the SqlParameterSource
containing the arguments for the queryDataAccessException
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper)
,
JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)
@Deprecated public <T> T queryForObject(java.lang.String sql, ParameterizedRowMapper<T> rm, SqlParameterSource args) throws DataAccessException
SimpleJdbcOperations
T
using the supplied
ParameterizedRowMapper
to the query results to the object.
Uses sql with the named parameter support provided by the
NamedParameterJdbcTemplate
queryForObject
in interface SimpleJdbcOperations
sql
- the SQL query to runrm
- the @ParameterizedRowMapper
to use for result mappingargs
- the SqlParameterSource
containing the arguments for the queryDataAccessException
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper)
,
JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)
public <T> T queryForObject(java.lang.String sql, RowMapper<T> rm, java.lang.Object... args) throws DataAccessException
SimpleJdbcOperations
T
using the supplied
RowMapper
to the query results to the object.
Uses sql with the standard '?' placeholders for parametersqueryForObject
in interface SimpleJdbcOperations
sql
- the SQL query to runrm
- the @RowMapper
to use for result mappingargs
- the variable number of arguments for the queryDataAccessException
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper)
,
JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)
@Deprecated public <T> T queryForObject(java.lang.String sql, ParameterizedRowMapper<T> rm, java.lang.Object... args) throws DataAccessException
SimpleJdbcOperations
T
using the supplied
ParameterizedRowMapper
to the query results to the object.
Uses sql with the standard '?' placeholders for parametersqueryForObject
in interface SimpleJdbcOperations
sql
- the SQL query to runrm
- the @ParameterizedRowMapper
to use for result mappingargs
- the variable number of arguments for the queryDataAccessException
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper)
,
JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)
public <T> java.util.List<T> query(java.lang.String sql, RowMapper<T> rm, java.util.Map<java.lang.String,?> args) throws DataAccessException
SimpleJdbcOperations
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
query
in interface SimpleJdbcOperations
sql
- the SQL query to runrm
- the @RowMapper
to use for result mappingargs
- the map containing the arguments for the queryDataAccessException
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper)
,
JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)
@Deprecated public <T> java.util.List<T> query(java.lang.String sql, ParameterizedRowMapper<T> rm, java.util.Map<java.lang.String,?> args) throws DataAccessException
SimpleJdbcOperations
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
query
in interface SimpleJdbcOperations
sql
- the SQL query to runrm
- the @ParameterizedRowMapper
to use for result mappingargs
- the map containing the arguments for the queryDataAccessException
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper)
,
JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)
public <T> java.util.List<T> query(java.lang.String sql, RowMapper<T> rm, SqlParameterSource args) throws DataAccessException
SimpleJdbcOperations
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
query
in interface SimpleJdbcOperations
sql
- the SQL query to runrm
- the @RowMapper
to use for result mappingargs
- the SqlParameterSource
containing the arguments for the queryDataAccessException
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper)
,
JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)
@Deprecated public <T> java.util.List<T> query(java.lang.String sql, ParameterizedRowMapper<T> rm, SqlParameterSource args) throws DataAccessException
SimpleJdbcOperations
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
query
in interface SimpleJdbcOperations
sql
- the SQL query to runrm
- the @ParameterizedRowMapper
to use for result mappingargs
- the SqlParameterSource
containing the arguments for the queryDataAccessException
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper)
,
JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)
public <T> java.util.List<T> query(java.lang.String sql, RowMapper<T> rm, java.lang.Object... args) throws DataAccessException
SimpleJdbcOperations
List
of Objects
of type T
using
the supplied RowMapper
to the query results to the object.
Uses sql with the standard '?' placeholders for parametersquery
in interface SimpleJdbcOperations
sql
- the SQL query to runrm
- the @RowMapper
to use for result mappingargs
- the variable number of arguments for the queryDataAccessException
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper)
,
JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)
@Deprecated public <T> java.util.List<T> query(java.lang.String sql, ParameterizedRowMapper<T> rm, java.lang.Object... args) throws DataAccessException
SimpleJdbcOperations
List
of Objects
of type T
using
the supplied ParameterizedRowMapper
to the query results to the object.
Uses sql with the standard '?' placeholders for parametersquery
in interface SimpleJdbcOperations
sql
- the SQL query to runrm
- the @ParameterizedRowMapper
to use for result mappingargs
- the variable number of arguments for the queryDataAccessException
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper)
,
JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)
public java.util.Map<java.lang.String,java.lang.Object> queryForMap(java.lang.String sql, java.util.Map<java.lang.String,?> args) throws DataAccessException
SimpleJdbcOperations
The query is expected to be a single row query; the result row will be
mapped to a MapNamedParameterJdbcTemplate
queryForMap
in interface SimpleJdbcOperations
sql
- the SQL query to runargs
- the map containing the arguments for the queryDataAccessException
JdbcOperations.queryForMap(String)
,
JdbcOperations.queryForMap(String, Object[])
public java.util.Map<java.lang.String,java.lang.Object> queryForMap(java.lang.String sql, SqlParameterSource args) throws DataAccessException
SimpleJdbcOperations
The query is expected to be a single row query; the result row will be
mapped to a MapNamedParameterJdbcTemplate
queryForMap
in interface SimpleJdbcOperations
sql
- the SQL query to runargs
- the SqlParameterSource
containing the arguments for the queryDataAccessException
JdbcOperations.queryForMap(String)
,
JdbcOperations.queryForMap(String, Object[])
public java.util.Map<java.lang.String,java.lang.Object> queryForMap(java.lang.String sql, java.lang.Object... args) throws DataAccessException
SimpleJdbcOperations
The query is expected to be a single row query; the result row will be
mapped to a Map
queryForMap
in interface SimpleJdbcOperations
sql
- the SQL query to runargs
- the variable number of arguments for the queryDataAccessException
JdbcOperations.queryForMap(String)
,
JdbcOperations.queryForMap(String, Object[])
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> queryForList(java.lang.String sql, java.util.Map<java.lang.String,?> args) throws DataAccessException
SimpleJdbcOperations
Each element in the returned List
is constructed as a Map
as described in SimpleJdbcOperations.queryForMap(java.lang.String, java.util.Map<java.lang.String, ?>)
Uses sql with the named parameter support provided by the
NamedParameterJdbcTemplate
queryForList
in interface SimpleJdbcOperations
sql
- the SQL query to runargs
- the map containing the arguments for the queryDataAccessException
JdbcOperations.queryForList(String)
,
JdbcOperations.queryForList(String, Object[])
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> queryForList(java.lang.String sql, SqlParameterSource args) throws DataAccessException
SimpleJdbcOperations
Each element in the returned List
is constructed as a Map
as described in SimpleJdbcOperations.queryForMap(java.lang.String, java.util.Map<java.lang.String, ?>)
Uses sql with the named parameter support provided by the
NamedParameterJdbcTemplate
queryForList
in interface SimpleJdbcOperations
sql
- the SQL query to runargs
- the SqlParameterSource
containing the arguments for the queryDataAccessException
JdbcOperations.queryForList(String)
,
JdbcOperations.queryForList(String, Object[])
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> queryForList(java.lang.String sql, java.lang.Object... args) throws DataAccessException
SimpleJdbcOperations
Each element in the returned List
is constructed as a Map
as described in SimpleJdbcOperations.queryForMap(java.lang.String, java.util.Map<java.lang.String, ?>)
Uses sql with the standard '?' placeholders for parameters
queryForList
in interface SimpleJdbcOperations
sql
- the SQL query to runargs
- the variable number of arguments for the queryDataAccessException
JdbcOperations.queryForList(String)
,
JdbcOperations.queryForList(String, Object[])
public int update(java.lang.String sql, java.util.Map<java.lang.String,?> args) throws DataAccessException
SimpleJdbcOperations
NamedParameterJdbcTemplate
update
in interface SimpleJdbcOperations
sql
- the SQL statement to executeargs
- the map containing the arguments for the queryDataAccessException
NamedParameterJdbcOperations.update(String, Map)
public int update(java.lang.String sql, SqlParameterSource args) throws DataAccessException
SimpleJdbcOperations
NamedParameterJdbcTemplate
update
in interface SimpleJdbcOperations
sql
- the SQL statement to executeargs
- the SqlParameterSource
containing the arguments for the statementDataAccessException
NamedParameterJdbcOperations.update(String, SqlParameterSource)
public int update(java.lang.String sql, java.lang.Object... args) throws DataAccessException
SimpleJdbcOperations
update
in interface SimpleJdbcOperations
sql
- the SQL statement to executeargs
- the variable number of arguments for the queryDataAccessException
JdbcOperations.update(String)
,
JdbcOperations.update(String, Object[])
public int[] batchUpdate(java.lang.String sql, java.util.List<java.lang.Object[]> batchArgs)
SimpleJdbcOperations
batchUpdate
in interface SimpleJdbcOperations
sql
- the SQL statement to executebatchArgs
- the List of Object arrays containing the batch of arguments for the querypublic int[] batchUpdate(java.lang.String sql, java.util.List<java.lang.Object[]> batchArgs, int[] argTypes)
SimpleJdbcOperations
batchUpdate
in interface SimpleJdbcOperations
sql
- the SQL statement to execute.batchArgs
- the List of Object arrays containing the batch of arguments for the queryargTypes
- SQL types of the arguments
(constants from java.sql.Types
)public int[] batchUpdate(java.lang.String sql, java.util.Map<java.lang.String,?>[] batchValues)
SimpleJdbcOperations
batchUpdate
in interface SimpleJdbcOperations
sql
- the SQL statement to executebatchValues
- the array of Maps containing the batch of arguments for the querypublic int[] batchUpdate(java.lang.String sql, SqlParameterSource[] batchArgs)
SimpleJdbcOperations
batchUpdate
in interface SimpleJdbcOperations
sql
- the SQL statement to executebatchArgs
- the array of SqlParameterSource
containing the batch of arguments for the queryprivate java.lang.Object[] getArguments(java.lang.Object[] varArgs)