2018.06.11 when I wrote a web program, I found a problem, solved it for several days, and couldn't find the problem. Accidentally Baidu found the root of the, hope can help everyone.
1
Throw an exception when calling this function. At first I thought it was the wrong code, looked for several days, did not find. The result is a database lock problem
2.1 First to see if your JSP page submitted to the servlet is successful! , in the Post () method of your servlet System.out.print ("Enter servlet");
2 See if there are any reactions!. If your JSP enters the servlet, your method description succeeds, and then check that your parameters are passed from the JSP.
Example: System.out.print (Request.getparamete ("NewsCore"))
3 System.out.print (New_score) in the servlet; check if your dynamically generated SQL statement is syntactically incorrect
4 executeupdate () in the St object; the method returns int you can System.out.print (St.executeupdate (New_score)); Check for changes have not succeeded
Three then if 123 can execute 4 error
You can determine the error because the database is locked
Four in the database lock mechanism introduced, the data lock is mainly used to ensure data consistency, the database lock from the lock granularity can be divided into table-level lock, row-level lock and page-level lock
About calling database functions executeupdate throwing exceptions