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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
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: 80

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: 36501
    
  16
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: 825
    
    5


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://aspose.com/file-tools
 
subject: Array Index outbounds error!? Please help!
 
Similar Threads
Problem With GUI of Net Beans
Problem adding JComboBox to JFrame
Storing JTextField to variable
Pressing a button to open a new window
Custom Cell renderer... A solution?