Re: Jdbc : DateStyle problem

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: Jdbc : DateStyle problem
Дата
Msg-id 46E143FE.2070407@opencloud.com
обсуждение исходный текст
Ответ на Jdbc : DateStyle problem  ("Laurent LS. Savary" <laurent.savary@medial.fr>)
Список pgsql-jdbc
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

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Achilleas Mantzios
Дата:
Сообщение: Re: Jdbc : DateStyle problem
Следующее
От: Dave Cramer
Дата:
Сообщение: Re: Caching driver on pgFoundry?