Mapping Java BigDecimal

From: Jakub Bednář <jakub(dot)bednar(at)b2bcentrum(dot)cz>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Mapping Java BigDecimal
Date: 2010-01-18 07:19:25
Message-ID: 4B540B7D.1080306@b2bcentrum.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2010-01-18 07:49:19 Re: Bug in AbstractJdbc2BlobClob
Previous Message John T. Dow 2010-01-16 03:08:44 Re: refreshRow is slow