Top Description Methods
org.springframework.jdbc.core

public Interface JdbcOperations

Known Direct Implementers
org.springframework.jdbc.core.JdbcTemplate
Imports
java.util.Collection, .List, .Map, java.util.stream.Stream, org.springframework.dao.DataAccessException, org.springframework.jdbc.support.KeyHolder, org.springframework.jdbc.support.rowset.SqlRowSet, org.springframework.lang.Nullable

Interface specifying a basic set of JDBC operations.

Implemented by JdbcTemplate. Not often used directly, but a useful option to enhance testability, as it can easily be mocked or stubbed.

Alternatively, the standard JDBC infrastructure can be mocked. However, mocking this interface constitutes significantly less work. As an alternative to a mock objects approach to testing data access code, consider the powerful integration testing support provided via the Spring TestContext Framework, in the spring-test artifact.

NOTE: As of 6.1, there is a unified JDBC access facade available in the form of org.springframework.jdbc.core.simple.JdbcClient. JdbcClient provides a fluent API style for common JDBC queries/updates with flexible use of indexed or named parameters. It delegates to JdbcOperations/NamedParameterJdbcOperations for actual execution.

Authors
Rod Johnson, Juergen Hoeller
See Also
JdbcTemplate, org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations

Method Summary

Modifier and TypeMethod and Description
public int[]

Returns:

an array of the number of rows affected by each statement
batchUpdate
(String...
defining an array of SQL statements that will be executed.
sql
)

Issue multiple SQL updates on a single JDBC Statement using batching.

public int[]

Returns:

an array of the number of rows affected by each statement (may also contain special JDBC-defined negative values for affected rows such as java.sql.Statement#SUCCESS_NO_INFO/java.sql.Statement#EXECUTE_FAILED)
batchUpdate
(String
defining PreparedStatement that will be reused. All statements in the batch will use the same SQL.
sql
,
BatchPreparedStatementSetter
object to set parameters on the PreparedStatement created by this method
pss
)

Issue multiple update statements on a single PreparedStatement, using batch updates and a BatchPreparedStatementSetter to set values.

public int[]

Returns:

an array of the number of rows affected by each statement (may also contain special JDBC-defined negative values for affected rows such as java.sql.Statement#SUCCESS_NO_INFO/java.sql.Statement#EXECUTE_FAILED)
batchUpdate
(PreparedStatementCreator
a callback that creates a PreparedStatement given a Connection
psc
,
BatchPreparedStatementSetter
object to set parameters on the PreparedStatement created by this method
pss
,
KeyHolder
a KeyHolder that will hold the generated keys
generatedKeyHolder
)

Issue multiple update statements on a single PreparedStatement, using batch updates and a BatchPreparedStatementSetter to set values.

public int[]

Returns:

an array containing the numbers of rows affected by each update in the batch (may also contain special JDBC-defined negative values for affected rows such as java.sql.Statement#SUCCESS_NO_INFO/java.sql.Statement#EXECUTE_FAILED)
batchUpdate
(String
the SQL statement to execute
sql
,
List<Object[]>
the List of Object arrays containing the batch of arguments for the query
batchArgs
)

Execute a batch using the supplied SQL statement with the batch of supplied arguments.

public int[]

Returns:

an array containing the numbers of rows affected by each update in the batch (may also contain special JDBC-defined negative values for affected rows such as java.sql.Statement#SUCCESS_NO_INFO/java.sql.Statement#EXECUTE_FAILED)
batchUpdate
(String
the SQL statement to execute.
sql
,
List<Object[]>
the List of Object arrays containing the batch of arguments for the query
batchArgs
,
int[]
the SQL types of the arguments (constants from java.sql.Types)
argTypes
)

Execute a batch using the supplied SQL statement with the batch of supplied arguments.

public <T> int[][]

Returns:

an array containing for each batch another array containing the numbers of rows affected by each update in the batch (may also contain special JDBC-defined negative values for affected rows such as java.sql.Statement#SUCCESS_NO_INFO/java.sql.Statement#EXECUTE_FAILED)
batchUpdate
(String
the SQL statement to execute.
sql
,
Collection<T>
the List of Object arrays containing the batch of arguments for the query
batchArgs
,
int
batch size
batchSize
,
ParameterizedPreparedStatementSetter<T>
the ParameterizedPreparedStatementSetter to use
pss
)

Execute multiple batches using the supplied SQL statement with the collect of supplied arguments.

public Map<String, Object>

Returns:

a Map of extracted out parameters
call
(CallableStatementCreator
a callback that provides SQL and any necessary parameters
csc
,
List<SqlParameter>
list of declared SqlParameter objects
declaredParameters
)

Execute an SQL call using a CallableStatementCreator to provide SQL and any required parameters.

public <T> T

Returns:

a result object returned by the action, or null if none
execute
(ConnectionCallback<T>
a callback object that specifies the action
action
)

Execute a JDBC data access operation, implemented as callback action working on a JDBC Connection.

public <T> T

Returns:

a result object returned by the action, or null if none
execute
(StatementCallback<T>
a callback that specifies the action
action
)

Execute a JDBC data access operation, implemented as callback action working on a JDBC Statement.

public void
execute(String
static SQL to execute
sql
)

Issue a single SQL execute, typically a DDL statement.

public <T> T

Returns:

a result object returned by the action, or null if none
execute
(PreparedStatementCreator
a callback that creates a PreparedStatement given a Connection
psc
,
PreparedStatementCallback<T>
a callback that specifies the action
action
)

Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement.

public <T> T

Returns:

a result object returned by the action, or null if none
execute
(String
the SQL to execute
sql
,
PreparedStatementCallback<T>
a callback that specifies the action
action
)

Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement.

public <T> T

Returns:

a result object returned by the action, or null if none
execute
(CallableStatementCreator
a callback that creates a CallableStatement given a Connection
csc
,
CallableStatementCallback<T>
a callback that specifies the action
action
)

Execute a JDBC data access operation, implemented as callback action working on a JDBC CallableStatement.

public <T> T

Returns:

a result object returned by the action, or null if none
execute
(String
the SQL call string to execute
callString
,
CallableStatementCallback<T>
a callback that specifies the action
action
)

Execute a JDBC data access operation, implemented as callback action working on a JDBC CallableStatement.

public <T> T

Returns:

an arbitrary result object, as returned by the ResultSetExtractor
query
(String
the SQL query to execute
sql
,
ResultSetExtractor<T>
a callback that will extract all rows of results
rse
)

Execute a query given static SQL, reading the ResultSet with a ResultSetExtractor.

public void
query(String
the SQL query to execute
sql
,
RowCallbackHandler
a callback that will extract results, one row at a time
rch
)

Execute a query given static SQL, reading the ResultSet on a per-row basis with a RowCallbackHandler.

public <T> List<T>

Returns:

the result List, containing mapped objects
query
(String
the SQL query to execute
sql
,
RowMapper<T>
a callback that will map one object per row
rowMapper
)

Execute a query given static SQL, mapping each row to a result object via a RowMapper.

public <T> T

Returns:

an arbitrary result object, as returned by the ResultSetExtractor
query
(PreparedStatementCreator
a callback that creates a PreparedStatement given a Connection
psc
,
ResultSetExtractor<T>
a callback that will extract results
rse
)

Query using a prepared statement, reading the ResultSet with a ResultSetExtractor.

public <T> T

Returns:

an arbitrary result object, as returned by the ResultSetExtractor
query
(String
the SQL query to execute
sql
,
PreparedStatementSetter
a callback that knows how to set values on the prepared statement. If this is null, the SQL will be assumed to contain no bind parameters. Even if there are no bind parameters, this callback may be used to set the fetch size and other performance options.
pss
,
ResultSetExtractor<T>
a callback that will extract results
rse
)

Query using a prepared statement, reading the ResultSet with a ResultSetExtractor.

public <T> T

Returns:

an arbitrary result object, as returned by the ResultSetExtractor
query
(String
the SQL query to execute
sql
,
Object[]
arguments to bind to the query
args
,
int[]
the SQL types of the arguments (constants from java.sql.Types)
argTypes
,
ResultSetExtractor<T>
a callback that will extract results
rse
)

Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.

public <T> T

Returns:

an arbitrary result object, as returned by the ResultSetExtractor
query
(String
the SQL query to execute
sql
,
Object[]
arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
args
,
ResultSetExtractor<T>
a callback that will extract results
rse
)

Deprecated as of 5.3, in favor of query(String, ResultSetExtractor, Object...)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.
public <T> T

Returns:

an arbitrary result object, as returned by the ResultSetExtractor
query
(String
the SQL query to execute
sql
,
ResultSetExtractor<T>
a callback that will extract results
rse
,
Object...
arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
args
)

Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.

public void
query(PreparedStatementCreator
a callback that creates a PreparedStatement given a Connection
psc
,
RowCallbackHandler
a callback that will extract results, one row at a time
rch
)

Query using a prepared statement, reading the ResultSet on a per-row basis with a RowCallbackHandler.

public void
query(String
the SQL query to execute
sql
,
PreparedStatementSetter
a callback that knows how to set values on the prepared statement. If this is null, the SQL will be assumed to contain no bind parameters. Even if there are no bind parameters, this callback may be used to set the fetch size and other performance options.
pss
,
RowCallbackHandler
a callback that will extract results, one row at a time
rch
)

Query given SQL to create a prepared statement from SQL and a PreparedStatementSetter implementation that knows how to bind values to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.

public void
query(String
the SQL query to execute
sql
,
Object[]
arguments to bind to the query
args
,
int[]
the SQL types of the arguments (constants from java.sql.Types)
argTypes
,
RowCallbackHandler
a callback that will extract results, one row at a time
rch
)

Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.

public void
query(String
the SQL query to execute
sql
,
Object[]
arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
args
,
RowCallbackHandler
a callback that will extract results, one row at a time
rch
)

Deprecated as of 5.3, in favor of query(String, RowCallbackHandler, Object...)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.
public void
query(String
the SQL query to execute
sql
,
RowCallbackHandler
a callback that will extract results, one row at a time
rch
,
Object...
arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
args
)

Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.

public <T> List<T>

Returns:

the result List, containing mapped objects
query
(PreparedStatementCreator
a callback that creates a PreparedStatement given a Connection
psc
,
RowMapper<T>
a callback that will map one object per row
rowMapper
)

Query using a prepared statement, mapping each row to a result object via a RowMapper.

public <T> List<T>

Returns:

the result List, containing mapped objects
query
(String
the SQL query to execute
sql
,
PreparedStatementSetter
a callback that knows how to set values on the prepared statement. If this is null, the SQL will be assumed to contain no bind parameters. Even if there are no bind parameters, this callback may be used to set the fetch size and other performance options.
pss
,
RowMapper<T>
a callback that will map one object per row
rowMapper
)

Query given SQL to create a prepared statement from SQL and a PreparedStatementSetter implementation that knows how to bind values to the query, mapping each row to a result object via a RowMapper.

public <T> List<T>

Returns:

the result List, containing mapped objects
query
(String
the SQL query to execute
sql
,
Object[]
arguments to bind to the query
args
,
int[]
the SQL types of the arguments (constants from java.sql.Types)
argTypes
,
RowMapper<T>
a callback that will map one object per row
rowMapper
)

Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a result object via a RowMapper.

public <T> List<T>

Returns:

the result List, containing mapped objects
query
(String
the SQL query to execute
sql
,
Object[]
arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
args
,
RowMapper<T>
a callback that will map one object per row
rowMapper
)

Deprecated as of 5.3, in favor of query(String, RowMapper, Object...)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a result object via a RowMapper.
public <T> List<T>

Returns:

the result List, containing mapped objects
query
(String
the SQL query to execute
sql
,
RowMapper<T>
a callback that will map one object per row
rowMapper
,
Object...
arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
args
)

Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a result object via a RowMapper.

public <T> List<T>

Returns:

a List of objects that match the specified element type
queryForList
(String
the SQL query to execute
sql
,
Class<T>
the required type of element in the result list (for example, Integer.class)
elementType
)

Execute a query for a result list, given static SQL.

public List<Map<String, Object>>

Returns:

a List that contains a Map per row
queryForList
(String
the SQL query to execute
sql
)

Execute a query for a result list, given static SQL.

public <T> List<T>

Returns:

a List of objects that match the specified element type
queryForList
(String
the SQL query to execute
sql
,
Object[]
arguments to bind to the query
args
,
int[]
the SQL types of the arguments (constants from java.sql.Types)
argTypes
,
Class<T>
the required type of element in the result list (for example, Integer.class)
elementType
)

Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

public <T> List<T>

Returns:

a List of objects that match the specified element type
queryForList
(String
the SQL query to execute
sql
,
Object[]
arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
args
,
Class<T>
the required type of element in the result list (for example, Integer.class)
elementType
)

Deprecated as of 5.3, in favor of queryForList(String, Class, Object...)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
public <T> List<T>

Returns:

a List of objects that match the specified element type
queryForList
(String
the SQL query to execute
sql
,
Class<T>
the required type of element in the result list (for example, Integer.class)
elementType
,
Object...
arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
args
)

Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

public List<Map<String, Object>>

Returns:

a List that contains a Map per row
queryForList
(String
the SQL query to execute
sql
,
Object[]
arguments to bind to the query
args
,
int[]
the SQL types of the arguments (constants from java.sql.Types)
argTypes
)

Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

public List<Map<String, Object>>

Returns:

a List that contains a Map per row
queryForList
(String
the SQL query to execute
sql
,
Object...
arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
args
)

Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

public Map<String, Object>

Returns:

the result Map (one entry per column, with column name as key)
queryForMap
(String
the SQL query to execute
sql
)

Execute a query for a result map, given static SQL.

public Map<String, Object>

Returns:

the result Map (one entry per column, with column name as key)
queryForMap
(String
the SQL query to execute
sql
,
Object[]
arguments to bind to the query
args
,
int[]
the SQL types of the arguments (constants from java.sql.Types)
argTypes
)

Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result map.

public Map<String, Object>

Returns:

the result Map (one entry for each column, using the column name as the key)
queryForMap
(String
the SQL query to execute
sql
,
Object...
arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
args
)

Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result map.

public <T> T

Returns:

the single mapped object (may be null if the given RowMapper returned null)
queryForObject
(String
the SQL query to execute
sql
,
RowMapper<T>
a callback that will map one object per row
rowMapper
)

Execute a query given static SQL, mapping a single result row to a result object via a RowMapper.

public <T> T

Returns:

the result object of the required type, or null in case of SQL NULL
queryForObject
(String
the SQL query to execute
sql
,
Class<T>
the type that the result object is expected to match
requiredType
)

Execute a query for a result object, given static SQL.

public <T> T

Returns:

the single mapped object (may be null if the given RowMapper returned null)
queryForObject
(String
the SQL query to execute
sql
,
Object[]
arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
args
,
int[]
the SQL types of the arguments (constants from java.sql.Types)
argTypes
,
RowMapper<T>
a callback that will map one object per row
rowMapper
)

Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a result object via a RowMapper.

public <T> T

Returns:

the single mapped object (may be null if the given RowMapper returned null)
queryForObject
(String
the SQL query to execute
sql
,
Object[]
arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
args
,
RowMapper<T>
a callback that will map one object per row
rowMapper
)

Deprecated as of 5.3, in favor of queryForObject(String, RowMapper, Object...)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a result object via a RowMapper.
public <T> T

Returns:

the single mapped object (may be null if the given RowMapper returned null)
queryForObject
(String
the SQL query to execute
sql
,
RowMapper<T>
a callback that will map one object per row
rowMapper
,
Object...
arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
args
)

Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a result object via a RowMapper.

public <T> T

Returns:

the result object of the required type, or null in case of SQL NULL
queryForObject
(String
the SQL query to execute
sql
,
Object[]
arguments to bind to the query
args
,
int[]
the SQL types of the arguments (constants from java.sql.Types)
argTypes
,
Class<T>
the type that the result object is expected to match
requiredType
)

Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.

public <T> T

Returns:

the result object of the required type, or null in case of SQL NULL
queryForObject
(String
the SQL query to execute
sql
,
Object[]
arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
args
,
Class<T>
the type that the result object is expected to match
requiredType
)

Deprecated as of 5.3, in favor of queryForObject(String, Class, Object...)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.
public <T> T

Returns:

the result object of the required type, or null in case of SQL NULL
queryForObject
(String
the SQL query to execute
sql
,
Class<T>
the type that the result object is expected to match
requiredType
,
Object...
arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
args
)

Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.

public SqlRowSet

Returns:

an SqlRowSet representation (possibly a wrapper around a javax.sql.rowset.CachedRowSet)
queryForRowSet
(String
the SQL query to execute
sql
)

Execute a query for an SqlRowSet, given static SQL.

public SqlRowSet

Returns:

an SqlRowSet representation (possibly a wrapper around a javax.sql.rowset.CachedRowSet)
queryForRowSet
(String
the SQL query to execute
sql
,
Object[]
arguments to bind to the query
args
,
int[]
the SQL types of the arguments (constants from java.sql.Types)
argTypes
)

Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting an SqlRowSet.

public SqlRowSet

Returns:

an SqlRowSet representation (possibly a wrapper around a javax.sql.rowset.CachedRowSet)
queryForRowSet
(String
the SQL query to execute
sql
,
Object...
arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
args
)

Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting an SqlRowSet.

public <T> Stream<T>

Returns:

the result Stream, containing mapped objects, needing to be closed once fully processed (e.g. through a try-with-resources clause)
queryForStream
(String
the SQL query to execute
sql
,
RowMapper<T>
a callback that will map one object per row
rowMapper
)

Execute a query given static SQL, mapping each row to a result object via a RowMapper, and turning it into an iterable and closeable Stream.

public <T> Stream<T>

Returns:

the result Stream, containing mapped objects, needing to be closed once fully processed (e.g. through a try-with-resources clause)
queryForStream
(PreparedStatementCreator
a callback that creates a PreparedStatement given a Connection
psc
,
RowMapper<T>
a callback that will map one object per row
rowMapper
)

Query using a prepared statement, mapping each row to a result object via a RowMapper, and turning it into an iterable and closeable Stream.

public <T> Stream<T>

Returns:

the result Stream, containing mapped objects, needing to be closed once fully processed (e.g. through a try-with-resources clause)
queryForStream
(String
the SQL query to execute
sql
,
PreparedStatementSetter
a callback that knows how to set values on the prepared statement. If this is null, the SQL will be assumed to contain no bind parameters. Even if there are no bind parameters, this callback may be used to set the fetch size and other performance options.
pss
,
RowMapper<T>
a callback that will map one object per row
rowMapper
)

Query given SQL to create a prepared statement from SQL and a PreparedStatementSetter implementation that knows how to bind values to the query, mapping each row to a result object via a RowMapper, and turning it into an iterable and closeable Stream.

public <T> Stream<T>

Returns:

the result Stream, containing mapped objects, needing to be closed once fully processed (e.g. through a try-with-resources clause)
queryForStream
(String
the SQL query to execute
sql
,
RowMapper<T>
a callback that will map one object per row
rowMapper
,
Object...
arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
args
)

Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a result object via a RowMapper, and turning it into an iterable and closeable Stream.

public int

Returns:

the number of rows affected
update
(String
static SQL to execute
sql
)

Issue a single SQL update operation (such as an insert, update or delete statement).

public int

Returns:

the number of rows affected
update
(PreparedStatementCreator
a callback that provides SQL and any necessary parameters
psc
)

Issue a single SQL update operation (such as an insert, update or delete statement) using a PreparedStatementCreator to provide SQL and any required parameters.

public int

Returns:

the number of rows affected
update
(PreparedStatementCreator
a callback that provides SQL and any necessary parameters
psc
,
KeyHolder
a KeyHolder that will hold the generated keys
generatedKeyHolder
)

Issue an update statement using a PreparedStatementCreator to provide SQL and any required parameters.

public int

Returns:

the number of rows affected
update
(String
the SQL containing bind parameters
sql
,
PreparedStatementSetter
helper that sets bind parameters. If this is null we run an update with static SQL.
pss
)

Issue an update statement using a PreparedStatementSetter to set bind parameters, with given SQL.

public int

Returns:

the number of rows affected
update
(String
the SQL containing bind parameters
sql
,
Object[]
arguments to bind to the query
args
,
int[]
the SQL types of the arguments (constants from java.sql.Types)
argTypes
)

Issue a single SQL update operation (such as an insert, update or delete statement) via a prepared statement, binding the given arguments.

public int

Returns:

the number of rows affected
update
(String
the SQL containing bind parameters
sql
,
Object...
arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
args
)

Issue a single SQL update operation (such as an insert, update or delete statement) via a prepared statement, binding the given arguments.