• Post Reply Bookmark Topic Watch Topic
  • New Topic

Illegalargument exception  RSS feed

 
Venkata Cherukuri
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • 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)
 
Max Habibi
town drunk
( and author)
Sheriff
Posts: 4118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It might be expecting a different type: say a BigDecimal

M
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • 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 ]
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!