You want to insert data into a database
Those data come from an html table, is that correct?
Start to move all the sql operations away from your jsp. Move them in the servlet.
A jsp file is used to show data, not to perform database operations.
In the same way move all html code away from your servlet and put it in a jsp. Servlet shouldn't build html anymore.
The steps are:
2) Let the Servlet get the parameters, perform database operations and forward control to a jsp. When you are done post the servlet code.
If the input mask parameters are disabled they arrive as null Strings to the servlet, so you can check them before performing the insert query.