• 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
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Illegalargument exception

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I get the following error when I am setting a double value to a prepared statement. What could be the possible reason, and a fix.

Caught unexpected exception : java.lang.IllegalArgumentException: Invalid Input Number
at oracle.sql.NUMBER.toBytes(NUMBER.java:926)
at oracle.jdbc.dbaccess.DBConversion.DoubleToNumberBytes(DBConversion.java:2990)
at oracle.jdbc.driver.OraclePreparedStatement.setDouble(OraclePreparedStatement.java:1552)
 
town drunk
( and author)
Posts: 4118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It might be expecting a different type: say a BigDecimal

M
 
Ranch Hand
Posts: 1923
Scala Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which way do you put the number into the statement?
You use a java.double.
And oracle expects what?
Perhaps oracle.double is something different than java.double.
[ July 21, 2004: Message edited by: Stefan Wagner ]
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmmm. What's the value of the double you're passing in? The OraclePreparedStatement method you're using takes a primitive double, so it looks like an Oracle driver bug, unless the value you're passing in is one of the special values - NaN, positive infinity, and negative infinity - that I would not necessarily expect a database to support.

- Peter
 
reply
    Bookmark Topic Watch Topic
  • New Topic