Re: precision of numeric type - Mailing list pgsql-jdbc

From w.winter
Subject Re: precision of numeric type
Date
Msg-id 00a501c27f77$6d3c4f60$667ba8c0@panzerknacker
Whole thread Raw
In response to precision of numeric type  ("w.winter" <w.winter@logitags.com>)
List pgsql-jdbc
----- Original Message -----
From: "Barry Lind" <blind@xythos.com>
To: "w.winter" <w.winter@logitags.com>
Cc: <pgsql-jdbc@postgresql.org>
Sent: Tuesday, October 29, 2002 5:53 PM
Subject: Re: [JDBC] precision of numeric type


> >
> > I store the Double value 1212121234.5634349876 with a
> > PreparedStatement.setDouble()
> >
>
> But the problem is that java Double isn't able to perform calculations
> exactly.  If you want exact precision you should be using the BigDecimal
> datatype (and getBigDecimal/setBigDecimal).  BigDecimal is the logical
> java data type that corresponds to the numeric type in postgres.
>

Hi Barry,

you are right, that was my error. I will use BigDecimal in this case.

thank you for the hint
Wolfgang



pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: Prepared Statement limit ?
Next
From: Kris Jurka
Date:
Subject: Re: DatabaseMetaData.getTables() problem