Re: Problem with to_date function

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: Problem with to_date function
Дата
Msg-id Pine.BSO.4.62.0508221544230.25580@leary.csoft.net
обсуждение исходный текст
Ответ на Problem with to_date function  (Gilberto C Andrade <gilbertoca@secad.to.gov.br>)
Список pgsql-jdbc

On Mon, 22 Aug 2005, Gilberto C Andrade wrote:

> ALTER DATABASE bcoproducao SET DateStyle=sql, european;
> ALTER DATABASE bcoproducao SET client_encoding=latin1;
>
> So, setting datestyle isn't the problem.

Yes, it actually is.  Neither of the above settings will have any effect
because when the JDBC driver first connects to your database it will
overwrite these settings with ISO and UNICODE respectively.  You may
verify this by running "SHOW DateStyle" from a JDBC connection.  The
driver needs these settings to operate correctly.

> Other thing, I'm reporting this because we (www.secad.to.gov.br) have several
> reports (jasperreports) using to_date() function and all are returning wrong
> results.
>

I am unfamiliar with jasperreports, but I would suggest using
PreparedStatement.setDate which will correctly format your dates, or use
the ISO format for dates and the to_date format string.

Kris Jurka

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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: Problem with to_date function
Следующее
От: Joost Kraaijeveld
Дата:
Сообщение: Is this error correct/possible?