Wolfgang,
w.winter wrote:
> Hi,
>
> on testing our auto-configuration persistence framework ACP against
> PostgreSQL we found the following problem:
>
> I have a table with a column of type numeric(48,10). The PostgreSQL docs
> say: "The type numeric can store numbers of practically unlimited size and
> precision, while being able to store all numbers and carry out all
> calculations exactly."
This is true.
>
> 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.
thanks,
--Barry