Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Not inserting in to the database

 
saku haruno
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I coded below code for inserting data into the database table by JSP using MySQL connectivity.



in above code sql4 is not working. please help me to find the error.
 
Claude Moore
Ranch Hand
Posts: 833
7
IBM DB2 Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, never code business logic or data access logic in a jsp page.
Second, your code as it is posted should not even compile... You are looping over two ResultSets, rs and rs2 (line 26) which are declare nowhere. Moreover if I remember well you should call clear parameters method on pst2 at each iteration.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!