Updating Data from a Java Class

Updating a row in a database table from a Java application requires you to do the following tasks:

  1. Create a method that finds a particular employee row. This is used to display the values for a particular employee on an edit page.
  2. Create a method that takes the updated employee data from the bean and updates the database.
  3. On the main application page, in every row of employee data, include a link that enables a user to edit the data for that employee. The links take the user to the edit.jsp file with the data for that employee displayed, ready for editing.
  4. Create a JSP page called edit.jsp, that includes a form and a table to display all the data of a single employee and enables a user to change the values.
  5. Create a JSP page that processes the form on the edit.jsp page, writes the updated values to the Employee.java bean and calls the updateEmployee method.