View Single Post

   
  #3 (permalink)  
Old 04-16-2008, 01:54 AM
Oliver Jowett
 
Posts: n/a
Default Re: Jdbc : DateStyle problem

Laurent LS. Savary wrote:

> But,why the modification of the datestyle, set by psql (alter
> database....), on my database is not effective on a jdbc session?


The JDBC driver resets DateStyle to a known value on each connection so
that it knows how to correctly format date values sent to the backend,
and correctly parse date values returned by the backend.

Really you should be using the JDBC methods that deal in terms of
java.sql.Date if you are manipulating dates (i.e.
PreparedStatement.setDate(), ResultSet.getDate() and so on). The driver
will then correctly handle the date value interpretation for you.

-O

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Reply With Quote