Re: [INTERFACES] Re: ResultSet.getDate

From: Peter T Mount <peter(at)retep(dot)org(dot)uk>
To: Aleksey Demakov <avd(at)gcom(dot)ru>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: [INTERFACES] Re: ResultSet.getDate
Date: 1999-02-05 06:56:00
Message-ID: Pine.LNX.4.04.9902050655300.22685-100000@maidast.retep.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

On 2 Feb 1999, Aleksey Demakov wrote:

> Peter Garner <peter_garner(at)yahoo(dot)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 ();

I'm thinking on doing this within the driver, forcing it to use iso all
the time.

Peter

--
Peter T Mount peter(at)retep(dot)org(dot)uk
Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres
Java PDF Generator: http://www.retep.org.uk/pdf

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Peter T Mount 1999-02-05 07:02:38 Re: [INTERFACES] Postgres Limitations
Previous Message Peter T Mount 1999-02-05 06:55:25 Re: [INTERFACES] Re: ResultSet.getDate