Re: Problem with datestyle and driver jdbc

From: Kris Jurka <books(at)ejurka(dot)com>
To: Alberto Molteni <albert82(at)tiscali(dot)it>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Problem with datestyle and driver jdbc
Date: 2005-06-30 20:31:31
Message-ID: Pine.BSO.4.56.0506301527300.7073@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Thu, 30 Jun 2005, Alberto Molteni wrote:

> today I subscribed to this mailing list. I hope someone can help me with
> my problem.
>
> When I try to set the datestyle of the driver
>
> org.postgresql.util.PSQLException: The server's DateStyle parameter was
> changed to SQL, DMY. The JDBC driver requires DateStyle to begin with
> ISO for correct operation.
>
> How can I change the code to have the date format as it is in the db
> (that is DD/MM/YYYY HH:MM:SS) and not as YYYY/MM/DD?
>

You should do any formatting you need by retrieving a java Date or
Timestamp object and using a java.text.SimpleDateFormat to turn it into
the text representation you desire.

Kris Jurka

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2005-06-30 23:05:14 Re: XA support
Previous Message peter royal 2005-06-30 20:17:57 Re: XA support