File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "ArrayIndexOutOfBoundsException" Watch "ArrayIndexOutOfBoundsException" New topic
Author

ArrayIndexOutOfBoundsException

Pranit Sonawane
Ranch Hand

Joined: Jul 29, 2011
Posts: 149

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: 60050
    
  65

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: 149

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: 19541
    
  16

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
 
Similar Threads
Retrieve data from other server using JavaScript
calling a java Script file into the Jsp
Problem with Struts2 validation
JDBC code with type 1 driver not working
"MVC" controller servlet