Re: JDBC and intervals

Поиск
Список
Период
Сортировка
От Dave Cramer
Тема Re: JDBC and intervals
Дата
Msg-id 1076370725.1594.134.camel@localhost.localdomain
обсуждение исходный текст
Ответ на JDBC and intervals  (Pablo Velasquez Rivas <pvelasquez@its.co.cr>)
Список 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 по дате отправления:

Предыдущее
От: Oliver Jowett
Дата:
Сообщение: Re: Use of instanceOf
Следующее
От: Dave Cramer
Дата:
Сообщение: closing statements when connection is closed