Hi , Neelima ,
Why dont you use MVC for such critical operation that is dealing with Database?
You can write simple Servlet and Java class that will handle your request.
your data base activity should follow below steps , and if your code is in MVC it will better to track where is actual error is coming and
above to maintain your code will be so easy.
check this simple steps: