• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

ArrayIndexOutOfBoundsException

 
Ranch Hand
Posts: 172
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67595
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 172
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 22504
122
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your insert statement is missing its closing ).
 
reply
    Bookmark Topic Watch Topic
  • New Topic