File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes java.sql.SQLException: ORA-01722: invalid number Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "java.sql.SQLException: ORA-01722: invalid number" Watch "java.sql.SQLException: ORA-01722: invalid number" New topic

java.sql.SQLException: ORA-01722: invalid number

sac gupta

Joined: Jul 31, 2006
Posts: 1
my Query is
stmt.executeUpdate("update AUTH set PASS='"+new1+"' where UID='"+uid+"'");

whert table defines as
create table AUTH(ID varchar2(15),PASS varchar2(15) ,primary key (ID))

I am facing problem
java.sql.SQLException: ORA-01722: invalid number

Pls help me as soon as possible email id
Binu Sen

Joined: Jul 31, 2006
Posts: 2
Your table does not have any column called UID....
stu derby
Ranch Hand

Joined: Dec 15, 2005
Posts: 333
Originally posted by Binu Sen:
Your table does not have any column called UID....

And if it did, and it was a numeric column, then your SQL is wrong. Don't put quote characters around numeric data, just around character data.

Better yet, use PreparedStatement instead, it's what the grown-up JDBC programmers use (mostly).
I agree. Here's the link:
subject: java.sql.SQLException: ORA-01722: invalid number
jQuery in Action, 3rd edition