Re: problems with datestyle

From: Kris Jurka <books(at)ejurka(dot)com>
To: João Paulo F(dot) Diniz <jpaulo(at)dcc(dot)ufmg(dot)br>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: problems with datestyle
Date: 2004-04-01 22:13:52
Message-ID: Pine.BSO.4.56.0404011711160.4684@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Thu, 1 Apr 2004, [ISO-8859-1] Joo 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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Marcus Andree S. Magalhaes 2004-04-01 22:51:22 Re: disabling seq scans
Previous Message Kris Jurka 2004-04-01 22:11:08 Re: disabling seq scans