Create

Find the code snippet pertaining to the create operation, where we will insert the user details:

override fun addNewUser(userModel: UserModel) {
val addQuery = "INSERT INTO users (name, email, contact_number) values (?,?,?)"
jdbcTemplate.update(addQuery,userModel.name,userModel.email,userModel.contact_number)
}

The addQuery = "INSERT INTO users (name, email, contact_number) values (?,?,?)" is the query to insert the user in the USER table. 

The jdbcTemplate.update() is the function where we use the query and user details as the parameters to insert in the database.

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

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