DELETE Query

Learn how to use the update method to delete a record from the database.

We'll cover the following

JdbcTemplate update() method

In the previous lesson, we learned that the update() method of the JdbcTemplate is used to execute INSERT as well as UPDATE queries. In this lesson, we will write a query to delete a row based on the ID value using the update() method of the JdbcTemplate class.

Let’s call the method which implements the delete functionality, deletePlayerById(). This method returns an integer value of the number of rows that were affected by the query.

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.