0 Replies Latest reply on Jun 9, 2003 4:20 AM by brian_it

    error truncating data

    brian_it Newbie

      We have a need use 18 digit of precisions in our application , which include 6 digit after the decimial point. We are using Sybase ASE 12.5 , however, some trunction happen which is not desirable:

      The Entity Bean uses CMP and has a numeric field as a BigDecimal


      public BigDecimal amount;

      The corresponding table field in Sybase is defined as:

      amount numeric(18,6)

      When inserting or updating a record into this field using CMP in JBoss, for example, when amount = 1.55, the value stored in Sybase is 1.

      I have tried using JDBC directly and there is no problem with a statement

      stmt.setBigDecimal(1, new BigDecimal("1.55"));

      This will insert the value 1.55 correctly.

      We have also tried changing standardjaws.xml to map BigDecimal to NUMERIC(x,y), where x, y are different numbers but it still did notwork.

      any suggestion or help is highly appreciated !