Skip site navigation (1) Skip section navigation (2)

Re: [JDBC] Re: Trouble with JDBC2 ResultSet.getDate()

From: Juhan-Peep Ernits <juhan(at)cc(dot)ioc(dot)ee>
To: Palle Girgensohn <girgen(at)partitur(dot)se>
Cc: pgsql-interfaces(at)postgresql(dot)org, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] Re: Trouble with JDBC2 ResultSet.getDate()
Date: 2001-05-08 15:20:40
Message-ID: Pine.GSO.4.21.0105081701090.27703-100000@suhkur.cc.ioc.ee (view raw or flat)
Thread:
Lists: pgsql-interfacespgsql-jdbc
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 :(


In response to

Responses

pgsql-interfaces by date

Next:From: Palle GirgensohnDate: 2001-05-08 16:28:54
Subject: Re: [JDBC] Re: Trouble with JDBC2 ResultSet.getDate()
Previous:From: Palle GirgensohnDate: 2001-05-08 14:16:31
Subject: Re: Trouble with JDBC2 ResultSet.getDate()

pgsql-jdbc by date

Next:From: Michael StephensonDate: 2001-05-08 15:22:22
Subject: Re: AGAIN: still no answer ... peter, or anybody knowledgeable, please ....
Previous:From: Bruce MomjianDate: 2001-05-08 15:01:09
Subject: Re: AGAIN: still no answer ... peter, or anybody knowledgeable, please ....

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group