Re: problems with datestyle - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: problems with datestyle
Date
Msg-id Pine.BSO.4.56.0404011711160.4684@leary.csoft.net
Whole thread Raw
In response to problems with datestyle  (João Paulo F. Diniz <jpaulo@dcc.ufmg.br>)
List pgsql-jdbc

On Thu, 1 Apr 2004, [ISO-8859-1] Jo�o Paulo F. Diniz wrote:

> Hi,
>
> I'm using a java program to connect to a postgresql database (I'm using
> postgresql version 7.2.1).
> I'd like to retrieve a value of type DATE with ResultSet.getString()
> method
> in the format dd/mm/yyyy without make any more changes in the program.
>
> I've already tried to Change PGDATESTYLE to "sql, european".

You cannot change the datestyle as the JDBC driver resets it to iso format
on connection start.  This simplifies the driver's life as it only needs
to know how to parse one date format.  If you want to format a date you
should be looking at getDate() and using java.text.DateFormat to make it
come out as you want instead of getString().

Kris Jurka


pgsql-jdbc by date:

Previous
From: João Paulo F. Diniz
Date:
Subject: problems with datestyle
Next
From: Kris Jurka
Date:
Subject: Re: disabling seq scans