Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ArrayIndexOutOfBoundsException

 
Pranit Sonawane
Ranch Hand
Posts: 171
Java MySQL Database Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is my HTML page


This is my JSP code to store the data in Database


Please Help me as it is giving me ArrayIndexOutOfBoundsException error
Many Thanks!!!
Also let me know if i'm using JSPs to store the data in a database or should i use HTML to display form and JSP just to display a response.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using JSP to display the form is fine. What is not fine is putting the Java code in your JSP. That's a poor practice that has been discredited for more than 10 years. 10 years! Don't you think it's time to catch up?

The Java code to access the DB should be in a Java class, not a JSP.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hint: what is the *count of Place holders* in your query?

very difficult to find the line which throws on exception right?... difficult to debug? Avoid putting java code in Jsp :)
 
Pranit Sonawane
Ranch Hand
Posts: 171
Java MySQL Database Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seetharaman Venkatasamy wrote:Hint: what is the *count of Place holders* in your query?

very difficult to find the line which throws on exception right?... difficult to debug? Avoid putting java code in Jsp :)

yeah Thanks i changed the code and made 23 question marks bu now its giving me an error at line 65 saying missing comma at
 
Rob Spoor
Sheriff
Pie
Posts: 20368
43
Chrome Eclipse IDE Java Windows
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your insert statement is missing its closing ).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic