Re: JDBC and intervals - Mailing list pgsql-jdbc

From Dave Cramer
Subject Re: JDBC and intervals
Date
Msg-id 1076370725.1594.134.camel@localhost.localdomain
Whole thread Raw
In response to JDBC and intervals  (Pablo Velasquez Rivas <pvelasquez@its.co.cr>)
List pgsql-jdbc
Pablo,


OK, I played with this a bit, you can do a cast of final - initial as a
time which the driver s/b able to deal with

davec=# select (final - initial)::time as x from intvl1;
    x
----------
 00:00:00
(1 row)

also naming it would be helpful, but this does sound like a driver bug.

Dave

On Mon, 2004-02-09 at 16:11, Pablo Velasquez Rivas wrote:
> Hi.
>
> I'm trying to get an interval from a postgresql query.
>
> I was using jdbc for postgresql 7.3.x, and my query was:
>
> ResultSet.executeQuery("SELECT (final_date - initial_date) FROM
> some_table") ;
>
> When I did something like this:
> System.out.println(resultSet.getObject(1)),  , I got the message: "
> Error = No class found for interval"
>
> So, I tried upgrating to postgresql 7.4.x, and if I do
> System.out.println(resultSet.getObject(1)) ,  I get : null.
>
> So, is there a way to get an interval from a postgresql query ?, or am
> I doing something wrong ??
>
>
> Thanks for any help.
> ==                                 ==
>    Pablo A. Velasquez Rivas
> Computer Science Engineer
> ==                                 ==
--
Dave Cramer
519 939 0336
ICQ # 14675561


pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: Use of instanceOf
Next
From: Dave Cramer
Date:
Subject: closing statements when connection is closed