Re: PreparedStatement rounds doubles to scale 14 during update - Mailing list pgsql-jdbc

From Heikki Linnakangas
Subject Re: PreparedStatement rounds doubles to scale 14 during update
Date
Msg-id 46DE9C1F.6030407@enterprisedb.com
Whole thread Raw
In response to Re: PreparedStatement rounds doubles to scale 14 during update  ("Peter Kovacs" <maxottovonstirlitz@gmail.com>)
Responses Re: PreparedStatement rounds doubles to scale 14 during update
Re: PreparedStatement rounds doubles to scale 14 during update
List pgsql-jdbc
Peter Kovacs wrote:
> Heikki,
>
> Thank you for your reply.
>
> What are base-10 datatypes? Are they numeric types? I cannot find them
> in the backend documentation.

I meant any data type that can accurately represent a base-10 decimal
number. In PostgreSQL, that's numeric. In Java, it's BigDecimal.

If you're not familiar with the differences between floating point and
decimal numbers, I'd suggest you to read on it. This python tutorial for
example has a pretty good chapter on the issues:
http://docs.python.org/tut/node16.html

> Is there a mapping of Java types to backend types documented somewhere?

There is for mapping between Java types and SQL types, see "Getting
Started with with the JDBC API" by Sun:

http://java.sun.com/j2se/1.5.0/docs/guide/jdbc/getstart/mapping.html

--
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com

pgsql-jdbc by date:

Previous
From: "Peter Kovacs"
Date:
Subject: Re: PreparedStatement rounds doubles to scale 14 during update
Next
From: "Peter Kovacs"
Date:
Subject: Re: PreparedStatement rounds doubles to scale 14 during update