Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id ED2C36327B4 for ; Mon, 18 Jan 2010 03:41:41 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 98664-10 for ; Mon, 18 Jan 2010 07:41:28 +0000 (UTC) X-Greylist: delayed 00:22:01.492138 by SQLgrey-1.7.6 Received: from mail.b2bcentrum.cz (dns.b2bcentrum.cz [62.77.97.39]) by mail.postgresql.org (Postfix) with ESMTP id 43A746323C7 for ; Mon, 18 Jan 2010 03:41:31 -0400 (AST) Received: from localhost (dns [127.0.0.1]) by mail.b2bcentrum.cz (Postfix) with ESMTP id 172CB1850002 for ; Mon, 18 Jan 2010 08:19:27 +0100 (CET) X-Virus-Scanned: amavisd-new at b2bcentrum.cz Received: from mail.b2bcentrum.cz ([127.0.0.1]) by localhost (dns.b2bcentrum.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8GTchijsnpvU for ; Mon, 18 Jan 2010 08:19:25 +0100 (CET) Received: from [192.168.1.77] (unknown [77.242.93.97]) (Authenticated sender: bednar) by mail.b2bcentrum.cz (Postfix) with ESMTP id 632C21850001 for ; Mon, 18 Jan 2010 08:19:25 +0100 (CET) Message-ID: <4B540B7D.1080306@b2bcentrum.cz> Date: Mon, 18 Jan 2010 08:19:25 +0100 From: =?UTF-8?B?SmFrdWIgQmVkbsOhxZk=?= User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Mapping Java BigDecimal Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=-10 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 201001/36 X-Sequence-Number: 20232 Hi All, We decide add support PostgreSQL database (now supporting only Oracle database) to our product. In Oracle we mapping Java BigDecimal to number(19, 2), in PostgreSQL to numeric(19, 2). If I store to "BigDecimal column" number without decimal, e.g. "3", than Oracle JDBC driver return "3", but PostgreSQL JDBC driver return "3.00". Is there some way (mapping, server setup, jdbc driver setup,...) how reach return number without trailing zeroes on decimal position? I'm using JDBC4 PostgreSQL Driver (v. 8.4-701) and PostgreSQL v. 8.1.18 (default for CentoOS 5.3). Thank you all ---- Jakub Bednar