Re: precision of numeric type

Поиск
Список
Период
Сортировка
От w.winter
Тема Re: precision of numeric type
Дата
Msg-id 00a501c27f77$6d3c4f60$667ba8c0@panzerknacker
обсуждение исходный текст
Ответ на precision of numeric type  ("w.winter" <w.winter@logitags.com>)
Список 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 по дате отправления:

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Re: Prepared Statement limit ?
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: DatabaseMetaData.getTables() problem