• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using BigDecimal in Hiberate

 
Elinor Chang
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am encountering a strange problem in retrieving data from database when the column is declared as decimal(16, 14). The data of the column is then saved as BigDecimal in java for further operation.

However I am getting random exception as the following when converting the BigDecimal to a double using .doubleValue(). Anybody has clause on why it happens? The exception happens randomly but persistantly...

Thanks


java.lang.NumberFormatException: For input string: "0.0000000000null"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1207)
at java.lang.Double.valueOf(Double.java:202)
at java.math.BigDecimal.doubleValue(BigDecimal.java:1033)
at sun.reflect.GeneratedMethodAccessor144.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

just a guess, but might It be Driver-related, instead of Hibernate?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic