wood burning stoves 2.0*
The moose likes JDBC 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
Bookmark "java.sql.SQLException: ORA-01722: invalid number" Watch "java.sql.SQLException: ORA-01722: invalid number" New topic
Author

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

sac gupta
Greenhorn

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 sachin17sep@gmail.com
Binu Sen
Greenhorn

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: http://aspose.com/file-tools
 
subject: java.sql.SQLException: ORA-01722: invalid number