What are doing with the data returned from database, like whether you are displaying it in HTML table or storing it. If you are displaying it as table, place a DIV tag around the table. On click of the save button get the innerHtml using that tag, place it in a hidden variable. Then you can use your servlet to do the rest. Hope this makes sense.