Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 319D910466 for ; Wed, 19 Feb 2014 11:25:26 +0000 (UTC) Received: (qmail 8690 invoked by uid 500); 19 Feb 2014 11:25:24 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 8404 invoked by uid 500); 19 Feb 2014 11:25:22 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 8372 invoked by uid 99); 19 Feb 2014 11:25:19 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Feb 2014 11:25:19 +0000 Date: Wed, 19 Feb 2014 11:25:19 +0000 (UTC) From: "Craig Chaney (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (DERBY-6483) JDBC setObject() on DECIMAL looses fractional part of value MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Craig Chaney created DERBY-6483: ----------------------------------- Summary: JDBC setObject() on DECIMAL looses fractional part of value Key: DERBY-6483 URL: https://issues.apache.org/jira/browse/DERBY-6483 Project: Derby Issue Type: Bug Components: JDBC Affects Versions: 10.8.2.2 Reporter: Craig Chaney Priority: Minor I have a table with a DECIMAL column: ij> describe MODEL.WORK_ITEM_BIG_DECIMAL_EXTENSIONS; COLUMN_NAME |TYPE_NAME|DEC&|NUM&|COLUM&|COLUMN_DEF|CHAR_OCTE&|IS_NULL& ------------------------------------------------------------------------------ JZ_PARENT_ID |CHAR |NULL|NULL|23 |NULL |46 |NO INTERNAL_ID |CHAR |NULL|NULL|23 |NULL |46 |NO KEY_COL |VARCHAR |NULL|NULL|250 |NULL |500 |NO VALUE |DECIMAL |4 |10 |28 |NULL |NULL |YES I use a prepared statement from the following SQL: UPDATE MODEL.WORK_ITEM_BIG_DECIMAL_EXTENSIONS SET VALUE = ? WHERE INTERNAL_ID = ? I set the first parameter like: BigDecimal bd = new BigDecimal("123.456"); ps.setObject(1, bd, Types.DECIMAL); This stores the incorrect value 123.0 into the database. It works fine if I do instead: ps.setBigDecimal(1, bd); -- This message was sent by Atlassian JIRA (v6.1.5#6160)