JavaRanch » Java Forums »
Java »
Swing / AWT / SWT
| 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
|
|
|
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
|
|
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.
|
 |
 |
|
|
subject: Array Index outbounds error!? Please help!
|
|
|
|