Re: Jdbc : DateStyle problem - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: Jdbc : DateStyle problem
Date
Msg-id 46E143FE.2070407@opencloud.com
Whole thread Raw
In response to Jdbc : DateStyle problem  ("Laurent LS. Savary" <laurent.savary@medial.fr>)
List pgsql-jdbc
Laurent LS. Savary wrote:

> But,why the modification of the datestyle, set by psql (alter
> database....), on my database is not effective on a jdbc session?

The JDBC driver resets DateStyle to a known value on each connection so
that it knows how to correctly format date values sent to the backend,
and correctly parse date values returned by the backend.

Really you should be using the JDBC methods that deal in terms of
java.sql.Date if you are manipulating dates (i.e.
PreparedStatement.setDate(), ResultSet.getDate() and so on). The driver
will then correctly handle the date value interpretation for you.

-O

pgsql-jdbc by date:

Previous
From: Achilleas Mantzios
Date:
Subject: Re: Jdbc : DateStyle problem
Next
From: Dave Cramer
Date:
Subject: Re: Caching driver on pgFoundry?