Meaningless Drivel is fun!*
The moose likes JDBC and the fly likes error of missing values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "error of missing values" Watch "error of missing values" New topic
Author

error of missing values

Megha Singhal
Ranch Hand

Joined: Feb 28, 2012
Posts: 182

AddUser.java



addUser.jsp

when i'm trying the above code the following error is coming
"ORA-00947: not enough values"
sarada bokka
Ranch Hand

Joined: Jan 13, 2010
Posts: 80
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.
Neeraj Dhiman
Ranch Hand

Joined: Dec 19, 2011
Posts: 63

This is probabaly the error of unequal set column and values you are inserting, in your SQL Query. just try this.


Correct Me if i am wrong
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1449
    
    6

Use PreparedStatement.


Swastik
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19651
    
  18

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: error of missing values
 
Similar Threads
Java-JSP
page gets hang on runtime
Data truncation: Truncated incorrect DOUBLE value:
Problem in record viewing
JQuery table manipulation