pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Juhan-Peep Ernits <juhan@cc.ioc.ee>
Cc: Palle Girgensohn <girgen@partitur.se>
Cc: pgsql-interfaces@postgresql.org
Cc: pgsql-jdbc@postgresql.org
Subject: Re: [JDBC] Re: Trouble with JDBC2 ResultSet.getDate()
Date: Tue, 8 May 2001 12:34:42 -0400 (EDT)
Message-ID: <200105081634.f48GYgn04910@candle.pha.pa.us> (raw)
In-Reply-To: <Pine.GSO.4.21.0105081701090.27703-100000@suhkur.cc.ioc.ee>


So, I am concluding that the timestamp patch should not be applied the
jdbc tree.

> 
> Hello!
> 
> We solved the problem by patching the code of the jdbc driver (since the
> new code has ResultSet.getStatement() method and other useful
> enhancements) for some time, while we changed the code to use
> getTimestamp() method, since it is not a good idea to stick to patching
> the code of the jdbc driver. 
> 
> Of course it would be more comfortable if one could use getDate on a
> timestamp field, but it is not by default always available.
> 
> In our case the new approach lead to more robust code (more typesafe),
> and in addition there were also a few other things that resolved when we
> started to use the new driver, so eventually we benefitted a lot of it. It
> depends how much code you have to rewrite but I'd suggest doing that.
> 
> Juhan Ernits
> 
> 
> 
> 
> On Tue, 8 May 2001, Palle Girgensohn wrote:
> 
> > I just got bitten by this too. I use type timestamp in the
> > database, and often need the latest timestamp, but want to
> > format it as a date. With 7.0.x, I just
> > 
> >  select ts from foo order by ts desc limit 1
> > 
> > and in java: d = res.getDate(1); 
> > 
> > but this fails everywhere in my code now :(
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



view thread (13+ messages)  latest in thread

Message-ID: <200105081634.f48GYgn04910@candle.pha.pa.us>
Permalink:  ../200105081634.f48GYgn04910@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200105081634.f48GYgn04910@candle.pha.pa.us

 · 

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: pgman@candle.pha.pa.us, juhan@cc.ioc.ee, girgen@partitur.se, pgsql-jdbc@postgresql.org
  Subject: Re: [JDBC] Re: Trouble with JDBC2 ResultSet.getDate()
  In-Reply-To: <200105081634.f48GYgn04910@candle.pha.pa.us>

* 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