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

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

From: Juhan-Peep Ernits <juhan(at)cc(dot)ioc(dot)ee>
To: Barry Lind <barry(at)xythos(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Re: [INTERFACES] Trouble with JDBC2 ResultSet.getDate()
Date: 2001-03-21 09:29:23
Message-ID: Pine.GSO.4.21.0103211054200.2066-100000@suhkur.cc.ioc.ee (view raw or flat)
Thread:
Lists: pgsql-interfacespgsql-jdbc

On Tue, 20 Mar 2001, Barry Lind wrote:

> Actually it was the changes in version 1.21 on 2/13 that broke this. 
> The cvs log for that change includes the following comment:
>   - Removed need for SimpleDateFormat in ResultSet.getDate() improving 
> performance.

Yes, of course. My mistake.

> My guess is the the code as written would work correctly for a 'date' 
> column, but doesn't work for a 'timestamp' column.  Is there a reason 
> you are not using getTimestamp() to get the value of the timestamp column?

The reason is that the code contains getDate() because it used to work and
we need to print it in date format. The Java SDK1.3 api description does
just say, that it 
gets the value of the designated column in the current row
of this ResultSet object as a java.sql.Date object in the Java programming language. 

It does not imply that the underlying column cannot be of Timestamp type,
since e.g. getString() works fine on numeric etc.

I do not know how many people have similar issues, but less performance
for more robustness would be my call in this case (i.e. rollback to
earlier version). 

But if other people do not experience those problems I'll look forward to
the modifications that Peter T Mount mentioned:

("One of the first things I'm doing once 7.1 is out is add some sanity
checking so that the get/set methods on Date, Timestamp, integer, double
etc so that getDate() on a Timestamp would work, but also
getTimestamp() on a Date column.") 

and have a workaround for the mean time.

Regards,

Juhan Ernits




In response to

pgsql-interfaces by date

Next:From: Peter EisentrautDate: 2001-03-21 22:06:10
Subject: Re: problem compiling the jdbc driver
Previous:From: Peter T MountDate: 2001-03-21 09:11:59
Subject: Re: Re: [INTERFACES] Trouble with JDBC2 ResultSet.getDate()

pgsql-jdbc by date

Next:From: Peter T MountDate: 2001-03-21 14:26:56
Subject: Re: pg703: support for Large objects via JDBC PreparedStatement.setBi naryStream()
Previous:From: Peter T MountDate: 2001-03-21 09:11:59
Subject: Re: Re: [INTERFACES] Trouble with JDBC2 ResultSet.getDate()

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