• 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

error of missing values

 
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
AddUser.java



addUser.jsp

when i'm trying the above code the following error is coming
"ORA-00947: not enough values"
 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a DB issue.
It say's the no of columns doesn't match with what you are trying to add. PERSONS table might be containing more or less columns.
 
Ranch Hand
Posts: 68
IBM DB2 Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is probabaly the error of unequal set column and values you are inserting, in your SQL Query. just try this.
 
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use PreparedStatement.
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Neeraj is right in that you need to specify the columns for inserting. Right now your statement expects a value for each and every column, in the right order. You're missing at least one value (possibly the auto-generated primary key?). Swastik is right that you should use PreparedStatement to prevent SQL injection.

And Megha, I believe this is the second time you posted code with some lines with very much spaces at the end. These mess up our forum layout a bit; can you try to remove those spaces next time? I've done it this time for you.
 
reply
    Bookmark Topic Watch Topic
  • New Topic