Re: Patch for JDBC timestamp problems

From: Michael Stephenson <mstephenson(at)tirin(dot)openworld(dot)co(dot)uk>
To: <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: Patch for JDBC timestamp problems
Date: 2001-01-16 09:43:02
Message-ID: Pine.LNX.4.30.0101160928380.3131-100000@tirin.openworld.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces pgsql-jdbc pgsql-patches

> Using static SimpleDateFormats will probably not cause threading
> issues. Common sense says that if the set methods are never called on
> them there will be no state change that my cause sync problems. But the
> spec doesn't garuntee it. Personally I would have no problem using
> static SimpleDateFormats if this were my code.

Unfortunately common sense is of no use in this case, at least as far as
ths Sun JDK 1.2.2 goes..

For parse() and format() it uses a Calendar object (originally defined in
DateFormat) for working on. Look at the code, it's truly frightening that
somebody would choose to write it this way.

Until yesterday I would have used static SimpleDateFormat objects in my
code too.. :o(

Michael Stephenson mstephenson(at)openworld(dot)co(dot)uk
Developer - Web Applications - Open World
Tel: +44 1225 444 950 Fax: +44 1225 336 738

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Adam Lang 2001-01-16 13:41:30 Re: ODBC with VISUAL BASIC applications to access POSTGRESQL db on LINUX??
Previous Message Peter T Mount 2001-01-16 09:12:46 Re: Deleting a list of external xinv/xinx files using JDBC

Browse pgsql-jdbc by date

  From Date Subject
Next Message William Webber 2001-01-17 00:36:58 Patch for jdbc Makefile
Previous Message Stu Coates 2001-01-15 22:20:11 JDBC buggy in 7.1beta3

Browse pgsql-patches by date

  From Date Subject
Next Message William Webber 2001-01-17 00:36:58 Patch for jdbc Makefile
Previous Message Peter Eisentraut 2001-01-15 21:03:38 Re: [PATCHES] docs: syntax.sgml patch