Re: europeans dates whith jdbc

Lists: pgsql-jdbc
From: Jean-Max Reymond <jmreymond(at)free(dot)fr>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: europeans dates whith jdbc
Date: 2003-12-15 14:24:01
Message-ID: 3FDDC401.3020606@free.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

iI have a 7.4 base created by createdb -E LATIN9 mybase and datestyle =
'Postgres, European' in the postgresql.conf config file. all is fine
with psql and my dates are displayed correctly.
But, with JDBC, I am unable to have the date in European format. there
are all in ISO format (YYYY-MM-DD).
does it exist a parameter to set?
thanks for yours answers,

--
Jean-Max Reymond email: jmreymond(at)free(dot)fr tel: 33 (0)6 16 94 25 11
http://jmreymond.free.fr/Etna2002


From: Kris Jurka <books(at)ejurka(dot)com>
To: Jean-Max Reymond <jmreymond(at)free(dot)fr>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: europeans dates whith jdbc
Date: 2003-12-15 14:43:31
Message-ID: Pine.LNX.4.33.0312150939340.5985-100000@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

On Mon, 15 Dec 2003, Jean-Max Reymond wrote:

> iI have a 7.4 base created by createdb -E LATIN9 mybase and datestyle =
> 'Postgres, European' in the postgresql.conf config file. all is fine
> with psql and my dates are displayed correctly.
> But, with JDBC, I am unable to have the date in European format. there
> are all in ISO format (YYYY-MM-DD).
> does it exist a parameter to set?
> thanks for yours answers,

I assume you are using getString() to retrieve the column in question? In
Java a more appropriate method would be to use getDate() and use the jvm's
locale settings to format it or SimpleDateFormat if that suits you better.

It is significantly easier for the JDBC driver to set and use its own
datestyle rather than having each date related call be conditional on the
current datestyle settings.

Kris Jurka


From: Jean-Max Reymond <jmreymond(at)free(dot)fr>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: europeans dates whith jdbc
Date: 2003-12-15 15:38:25
Message-ID: 3FDDD571.8070606@free.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Kris Jurka wrote:

>I assume you are using getString() to retrieve the column in question? In
>Java a more appropriate method would be to use getDate() and use the jvm's
>locale settings to format it or SimpleDateFormat if that suits you better.
>
>It is significantly easier for the JDBC driver to set and use its own
>datestyle rather than having each date related call be conditional on the
>current datestyle settings.
>
>Kris Jurka
>
>
>
>
>
works fine now with your solution.
thanks a lot,

--
Jean-Max Reymond email: jmreymond(at)free(dot)fr tel: 33 (0)6 16 94 25 11
http://jmreymond.free.fr/Etna2002