2 Replies Latest reply on Mar 12, 2005 7:40 PM by randahl

    Double trouble: Invalid numeric parameter

    randahl

      JBoss: 3.1
      Hibernate: 2.1
      SapDB: 7

      I have been stuck for some time with the exception shown below which is thrown whenever I try to persist entities which contain properties of type double. During the debugging process I am mapping my java doubles to the sql type Float(38) which is the most precise sapdb floating point numbers, containing up to 38 digits (not bits) which should be more than enough to represent Java doubles which contain a 52 bit number (the mantissa) and an 11 bit exponent. It does not matter what my double values are - the exception is thrown EVEN if I try to persist 0.0.

      If anyone could come up with an idea what could be wrong, I would be grateful.

      Randahl



      Exception:

      Caused by: com.sap.dbtech.jdbc.exceptions.DatabaseException: [-3018] (at 85): In
      valid numeric parameter
      at com.sap.dbtech.jdbc.packet.ReplyPacket.createException(ReplyPacket.ja
      va:69)
      at com.sap.dbtech.jdbc.ConnectionSapDB.throwSQLError(ConnectionSapDB.jav
      a:748)
      at com.sap.dbtech.jdbc.ConnectionSapDB.execute(ConnectionSapDB.java:422)

      at com.sap.dbtech.jdbc.ConnectionSapDB.execute(ConnectionSapDB.java:316)

      at com.sap.dbtech.jdbc.CallableStatementSapDB.execute(CallableStatementS
      apDB.java:382)
      at com.sap.dbtech.jdbc.CallableStatementSapDB.execute(CallableStatementS
      apDB.java:291)
      at com.sap.dbtech.jdbc.CallableStatementSapDB.executeUpdate(CallableStat
      ementSapDB.java:697)
      at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdat
      e(WrappedPreparedStatement.java:335)
      at net.sf.hibernate.persister.NormalizedEntityPersister.update(Normalize
      dEntityPersister.java:695)
      ... 42 more