• 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

Environment problem: ORA-01722: invalid number

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.
I have problems executing a Java program. It’s running OK in my local environment but I get this error running the jar from a Linux Red Hat 64-bit server:

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

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)


I run the same jar in another Linux Red Hat 32-bit server and it’s OK. The program is connecting to a database in another server. I tried to execute the jar in several JVM (Sun and jRockit) and several versions in both environments, and I keep getting the exception in the Linux Red Hat 64-bitserver. It’s running OK with both JVM in local and in Linux Red Hat 32-bit server.
Architectures:

1) My PC is a Win XP (x86) and I run the program with Eclipse.

2) Linux Server with Exception: redhat-4 (x64)
3) Linux Server OK: Red Hat Enterprise Linux AS release 4 (Nahant Update 5) (x86)

4) Data Base: Oracle 11gR2

Any idea?

Thank you in advance.
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jose, and welcome to the Ranch!

As you didn't post the actual code, it is really hard to say, but my bet is: you're using a simple Statement with literal values, instead of PreparedStatement and bind variables. The national language settings is different on Linux and the numeric format of literal is not valid there. Your code is therefore subject to SQL injection attacks and implicit conversion bugs.

Again, this is only a guess since you didn't provide the code, but this is the most probable cause. If this doesn't help, use the stack trace to locate statement being executed and show us that code.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are many reasons responsible for ORA-01722: invalid number, in order to fix this problem, you have to compare the numeric column along with the character column, while doing this it ensures that in the table the format mask would fit in all possible character strings. Make sure that the rows are executed with the Where clause, and if you are unsure that both the character strings and valid numbers are within the column, then just “Select*From Table” and you got the error then set proper locate in your “exeSQL” method to fix the error. Or else you can fix the error using a third party software, Oracle File Repair Tool, to fix the errors of related to Oracle database easily.
 
reply
    Bookmark Topic Watch Topic
  • New Topic