I am trying to add an employee record. The problem I am facing is, on clicking on "Create" I get an exception that the unique constraint is violated on the Emp_No field,
While I debugged, I found that it called the doPost method and based on the action parameter set ( in this case addNewEmp) it calls the appropriate method in the servlet)
and that the record is created, but strangely it again tries to insert the same record, that is the method doAddNewEmp(..) is called again.... I have no idea as why this is happening, this has taken a few days of mine without any progress..
Could ne1 help me out in figuring why this is happening pls....??
:::JSP CODE SNIPPET:::
:::SERVLET CODE SNIPPET:::
In my case it always is redirected to the page in the catch (SQLException) part.. indicating SQL exception has occurred.. But the record has been inserted into the database...
Any suggestions please?