DELETE

Find the code snippet for delete operation:

override fun deleteUser(id: Int) {
val deleteQuery = "DELETE FROM users WHERE id=?"
jdbcTemplate.update(deleteQuery, id)
}

deleteQuery = "DELETE FROM users WHERE id=?" is the query to update a user from user table by using the ID. jdbcTemplate.update() will execute the query and delete the specific data.

With these functions, we have finished our repository class.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.168.8