Re: [INTERFACES] Re: ResultSet.getDate

Поиск
Список
Период
Сортировка
От Aleksey Demakov
Тема Re: [INTERFACES] Re: ResultSet.getDate
Дата
Msg-id 871zk9zafb.fsf@avd.gcom.ru
обсуждение исходный текст
Ответ на Re: ResultSet.getDate  (Peter Garner <peter_garner@yahoo.com>)
Ответы Re: [INTERFACES] Re: ResultSet.getDate  (Peter T Mount <peter@retep.org.uk>)
Список pgsql-interfaces
Peter Garner <peter_garner@yahoo.com> writes:

> I am using the JDK 1.1.7v1a from Blackdown.  Indeed,
> Java's handling of dates is a little funky.  But in
> this case the problem is that the returned strings
> are not being handled properly.  Calling getString
> instead of getDate returns :
>
> "Mon Feb 01 16:08:00 1999 UTC"
>
> And the format string used in the SimpleDateFormatter
> object that getDate uses to convert that string is
> not correct for that format.  If there is anything I
> can do to help, please let me know! :-)

Perhaps opening your connections as follows might help you

...
    // open connection
    conn = DriverManager.getConnection (url, usr, pwd);

    // set datestyle
    Statement st = conn.createStatement ();
    st.executeUpdate ("set datestyle='iso'");
    st.executeUpdate ("show datestyle");
    st.close ();
...

--
Aleksey Demakov
avd@gcom.ru

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

Предыдущее
От: "Thomas G. Lockhart"
Дата:
Сообщение: Re: [INTERFACES] LinuxODBC
Следующее
От: "Gregory W Burnham"
Дата:
Сообщение: More about large objects