View Single Post

   
  #2 (permalink)  
Old 04-15-2008, 11:22 PM
Kris Jurka
 
Posts: n/a
Default Re: Problem with datestyle and driver 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

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Reply With Quote