Hello,
I am getting the data fields twice in println and while inserting in database.
Please help.
Where is the bug?
or any other method can be adopted
Code is as follows-
What are you trying to do here is simply erratic and should not be followed. Render your view at JSP and not on Servlet and try to separate your Persistence and Presentation logic.
Hi...
I am also facing the same problem.
I had been separated the design and coding but when the last page (in which the addToDB() method(which includes the actual code to insert the data)is called) is loaded, the data is automatically inserted in the database.
and then after clicking the button again values are inserted.