Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JSP and the fly likes ArrayIndexOutOfBoundsException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "ArrayIndexOutOfBoundsException" Watch "ArrayIndexOutOfBoundsException" New topic
Author

ArrayIndexOutOfBoundsException

Pranit Sonawane
Ranch Hand

Joined: Jul 29, 2011
Posts: 155

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

Joined: Jan 10, 2002
Posts: 61233
    
  66

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

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

Joined: Jul 29, 2011
Posts: 155

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

Joined: Oct 27, 2005
Posts: 19697
    
  20

Your insert statement is missing its closing ).


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ArrayIndexOutOfBoundsException