File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Array Index outbounds error!? Please help! Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Array Index outbounds error!? Please help! " Watch "Array Index outbounds error!? Please help! " New topic
Author

Array Index outbounds error!? Please help!

Yuta Lolap
Ranch Hand

Joined: Jun 03, 2012
Posts: 65

Hello all, i am running the above code in netbeans.

Getting the following error:






My database is as follows. I have given the right datatype as well as a lot of storage too! i still wonder why it is giving me that error.


SQL> desc customers;
Name Null? Type
----------------------------------------- -------- ----------------------------
CUSTOMER_ID NOT NULL VARCHAR2(10)
FNAME NOT NULL VARCHAR2(50)
MNAME VARCHAR2(50)
LNAME NOT NULL VARCHAR2(50)
ADDRESS VARCHAR2(50)
CONTACTNO VARCHAR2(10)
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32654
    
    4
If you get that exception with (5) it means you are trying to access the No 5 (i.e. 6th) member of a 5‑element, or smaller, array. That array might be hidden inside an ArrayList or similar class. Use the stack trace to work out whereabouts in the code it happened.
Kemal Sokolovic
Bartender

Joined: Jun 19, 2010
Posts: 792
    
    2


Your query is working with 5 parameters, and you're setting 6 of them (lines 160 - 167 of your code). From it, I guess you are missing customerid in your query (and corresponding '?' for it).


The quieter you are, the more you are able to hear.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Array Index outbounds error!? Please help!
 
Similar Threads
Storing JTextField to variable
Problem With GUI of Net Beans
Custom Cell renderer... A solution?
Pressing a button to open a new window
Problem adding JComboBox to JFrame