BigDecimal

From: Glenn Holmer <gholmer(at)weycogroup(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: BigDecimal
Date: 2002-02-11 14:45:45
Message-ID: 3C67D919.4070908@weycogroup.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

We're starting a Java project for our retail stores using Postgres,
and would like to store BigDecimal values for price, payment, etc.
because the data will be exported to an IBM iSeries server ("AS/400").
What is the correct Postgres data type to use? I would assume
"decimal"; when the docs say "User-specified precision" with a range
of "~8000 digits" does that mean the decimal point can fall anywhere
within those 8000 digits?

I was able to write a BigDecimal into a field of type "decimal" using

statement.executeQuery("INSERT INTO TEST VALUES(" + myBigDecimal + ")");

but when I try to read using ResultSet.getBigDecimal(), I get an
error message saying it's not implemented. We're using Postgres
7.0.3 on SuSE Linux. Should we upgrade to 7.1? I realize 7.2 just
came out, but we prefer to install from SuSE RPMs, which I don't
think are available yet. Or is there a later driver that implements
this, that we could use with 7.0 or 7.1?

--
____________________________________________________________
Glenn Holmer gholmer(at)weycogroup(dot)com
Programmer/Analyst phone: 414.908.1809
Weyco Group, Inc. fax: 414.908.1601

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Marc G. Fournier 2002-02-11 14:46:53 Re: JDBC split and move ...
Previous Message Nick Fankhauser 2002-02-11 13:27:52 Re: JDBC split and move ...