• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Array Index outbounds error!? Please help!

 
Ranch Hand
Posts: 86
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
 
Marshal
Posts: 79178
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 825
5
Python Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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).
 
reply
    Bookmark Topic Watch Topic
  • New Topic