pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rachel Greenham <rachel@enlarion.demon.co.uk>
To: pgsql-interfaces@postgresql.org
Subject: JDBC6.5-1.2 bug wrt timestamp
Date: Thu, 24 Jun 1999 14:05:24 +0100
Message-ID: <37722D14.8C5B4F52@enlarion.demon.co.uk> (raw)

I've just come across a bug in the latest JDBC driver for JDK1.2.

Given a field in the database which is of type timestamp, I've been
retrieving the value using ResultSet.getTimestamp("col") eg:

Date d = rs.getTimeStamp("col");

This has been fine under JDBC6.4

The error I get is: 

Could not execute query (Bad Timestamp Format at 1999-06-09
15:34:05Africa/Algiers in {2}) 

The value in the database as seen by getString() is:

1999-06-29 00:00:00+01

The system timezone is set to "Europe/London".

OK, the first thing is that the Africa/Algiers bit seem to be a JVM
problem - ie: TimeZone.getDefault() returns timezone id "Africa/Algiers"
on my system, which is configured for "Europe/London". I'll be chasing
that separately.

Unfortunately, I couldn't override because
ResultSet.getTimestamp(String, TimeZone) hasn't been implemented yet
(that's the error I get anyway) but I also suspect from the above error
that it wouldn't work anyway.

For the time being I'm just getting the value as a String and parsing it
by hand.

-- 
Rachel





view thread (3+ messages)  latest in thread

Message-ID: <37722D14.8C5B4F52@enlarion.demon.co.uk>
Permalink:  ../37722D14.8C5B4F52@enlarion.demon.co.uk/
Also on:    postgresql.org/message-id/37722D14.8C5B4F52@enlarion.demon.co.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: rachel@enlarion.demon.co.uk
  Subject: Re: JDBC6.5-1.2 bug wrt timestamp
  In-Reply-To: <37722D14.8C5B4F52@enlarion.demon.co.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox