This example shows how to update the existing record of mysql table using jdbc connectivity in the jsp page. In this example we have created two jsp pages update.jsp and updatingDatabase.jsp. In the update.jsp page, we are using a Text box where user can give his/her name and submit the page. After submitting the page, updatingDatabase.jsp will be called and the sql query ("update servlet set name = ? where id = ?") is executed which will modify the table record.
Type the url: http://localhost:8080/ServletExample/jsp/update.jsp on your browser. Following output will be displayed:
After submitting the name, it will be updated in the database and the records will be displayed on your browser.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.