pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: dmp <danap@ttc-cmc.net>
To: pgsql-jdbc@postgresql.org
Subject: Re: Mapping Java BigDecimal
Date: Tue, 19 Jan 2010 21:27:46 -0700
Message-ID: <4B568642.1000004@ttc-cmc.net> (raw)
In-Reply-To: <DA57411E4BD748F8B3ACFC7C4E3E6B1C@DEVELOP1>
References: <4B540B7D.1080306@b2bcentrum.cz>
	<4B541C40.9040206@postnewspapers.com.au>
	<407d949e1001180209v39e46a88v6d5a0e5a181a5d84@mail.gmail.com>
	<4B55371B.40105@postnewspapers.com.au>
	<407d949e1001190304m1bfea314ta5bd89e035d01c9@mail.gmail.com>
	<4B55C8D3.7090907@ttc-cmc.net>
	<DA57411E4BD748F8B3ACFC7C4E3E6B1C@DEVELOP1>

> I would like to disagree with the statement that PostgreSQL
> numeric is a real with rounding to the precision specified.


I concede my mis-statement.

> 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


Oracle NUMBER(19,2), (precision,scale) is just the same as 
NUMERIC(19,2), but if do

Oracle NUMBER(19,2) ----> PostgreSQL Numeric, no precision yields the 
desired result
as Jakub has figured out and keeps whatever precision input.

danap.




view thread (15+ messages)  latest in thread

Message-ID: <4B568642.1000004@ttc-cmc.net>
Permalink:  ../4B568642.1000004@ttc-cmc.net/
Also on:    postgresql.org/message-id/4B568642.1000004@ttc-cmc.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: danap@ttc-cmc.net
  Subject: Re: Mapping Java BigDecimal
  In-Reply-To: <4B568642.1000004@ttc-cmc.net>
  References: <4B540B7D.1080306@b2bcentrum.cz> <4B541C40.9040206@postnewspapers.com.au> <407d949e1001180209v39e46a88v6d5a0e5a181a5d84@mail.gmail.com> <4B55371B.40105@postnewspapers.com.au> <407d949e1001190304m1bfea314ta5bd89e035d01c9@mail.gmail.com> <4B55C8D3.7090907@ttc-cmc.net> <DA57411E4BD748F8B3ACFC7C4E3E6B1C@DEVELOP1> <4B568642.1000004@ttc-cmc.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox