I have prepared a form for inserting, viewing and deleting data and now I want to add option to edit that data but either I am following wrong way to do it or I dont know how to
firstly on the page HTML page create one hidden field to identify which operation you want to perform
initially its value should be blank and based on click whether insert update or delete assign some unique values to all the available operations.and from your servlets get that field as req.getParameter("
and based on that put your code in respective if and else if block so that only that code will run.
hope this will help