Re: Problem with datestyle and driver jdbc - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: Problem with datestyle and driver jdbc
Date
Msg-id Pine.BSO.4.56.0506301527300.7073@leary.csoft.net
Whole thread Raw
In response to Problem with datestyle and driver jdbc  ("Alberto Molteni" <albert82@tiscali.it>)
List 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

pgsql-jdbc by date:

Previous
From: peter royal
Date:
Subject: Re: XA support
Next
From: Oliver Jowett
Date:
Subject: Re: XA support