Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
sac gupta
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your table does not have any column called UID....
 
stu derby
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!