spring-framework / org.springframework.jdbc.core.namedparam / NamedParameterJdbcOperations / update

update

abstract fun update(sql: String, paramSource: SqlParameterSource): Int

Issue an update via a prepared statement, binding the given arguments.

Parameters

sql - SQL containing named parameters

paramSource - container of arguments and SQL types to bind to the query

Exceptions

org.springframework.dao.DataAccessException - if there is any problem issuing the update

Return
the number of rows affected

abstract fun update(sql: String, paramMap: MutableMap<String, *>): Int

Issue an update via a prepared statement, binding the given arguments.

Parameters

sql - SQL containing named parameters

paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)

Exceptions

org.springframework.dao.DataAccessException - if there is any problem issuing the update

Return
the number of rows affected

abstract fun update(sql: String, paramSource: SqlParameterSource, generatedKeyHolder: KeyHolder): Int

Issue an update via a prepared statement, binding the given arguments, returning generated keys.

Parameters

sql - SQL containing named parameters

paramSource - container of arguments and SQL types to bind to the query

generatedKeyHolder - KeyHolder that will hold the generated keys

Exceptions

org.springframework.dao.DataAccessException - if there is any problem issuing the update

Return
the number of rows affected

See Also
MapSqlParameterSourceorg.springframework.jdbc.support.GeneratedKeyHolder

abstract fun update(sql: String, paramSource: SqlParameterSource, generatedKeyHolder: KeyHolder, keyColumnNames: Array<String>): Int

Issue an update via a prepared statement, binding the given arguments, returning generated keys.

Parameters

sql - SQL containing named parameters

paramSource - container of arguments and SQL types to bind to the query

generatedKeyHolder - KeyHolder that will hold the generated keys

keyColumnNames - names of the columns that will have keys generated for them

Exceptions

org.springframework.dao.DataAccessException - if there is any problem issuing the update

Return
the number of rows affected

See Also
MapSqlParameterSourceorg.springframework.jdbc.support.GeneratedKeyHolder