Results 1 to 1 of 1
  1. #1
    Join Date
    Jul 2009

    Unanswered: DECFLOAT and BigDecimal with infinite values

    I have a table where a column is DECFLOAT(16). I need to do some basic retrieval and inserts from it using entity beans. I am using BigDecimal as the type in my entities. Everything is fine till I have records in the table where the DECFLOAT column has 'infinite' as the value in it. I get the error below:

    Caused by: [ibm][db2][jcc][converters][604][10987] Infinity or -Infinity received for DECFLOAT(16).
    	at org.apache.openjpa.lib.jdbc.DelegatingResultSet.getBigDecimal(
    Also, looks like BigDecimal cannot be instantiated with infinity values (from Javadoc):

    public BigDecimal(double val)
        NumberFormatException - if val is infinite or NaN.
    I guess my question is it possible to use BigDecimal for DB2 column of type DECFLOAT or is there some other type that needs to be used.

    > db2level
    DB21085I  Instance "db2inst2" uses "64" bits and DB2 code release "SQL09055"
    with level identifier "06060107".
    Informational tokens are "DB2 v9.5.0.5", "s091123", "MI00316", and Fix Pack
    Product is installed at "/opt/ibm/db2/V9.5".
    > db2licm -l
    Product name:                     "DB2 Enterprise Server Edition"
    License type:                     "Trial"
    Expiry date:                      "09/08/2010"
    Product identifier:               "db2ese"
    Version information:              "9.5"
    Product name:                     "DB2 Connect Server"
    License type:                     "Trial"
    Expiry date:                      "09/08/2010"
    Product identifier:               "db2consv"
    Version information:              "9.5"
    Last edited by raks81; 07-06-10 at 07:29.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts