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.
<%@page language="java" session="true"
|
Type the url: http://localhost:8080/ServletExample/jsp/update.jsp on your browser. Following output will be displayed:

updatingDatabase.jsp
<%@ page language = "java" contentType =
|
After submitting the name, it will be updated in the database and the records will be displayed on your browser.


|
Recommend the tutorial |


Ask Questions? Discuss: Update Database Table using JDBC in JSP View All Comments
Post your Comment