Re: [INTERFACES] JDBC line count in query result

Поиск
Список
Период
Сортировка
От Peter T Mount
Тема Re: [INTERFACES] JDBC line count in query result
Дата
Msg-id Pine.LNX.3.96.980804184616.7573J-100000@maidast.retep.org.uk
обсуждение исходный текст
Ответ на JDBC line count in query result  (Bernhard Ertl <ertl@edupsy.uni-muenchen.de>)
Список pgsql-interfaces
On Tue, 4 Aug 1998, Bernhard Ertl wrote:

> If I do a query with psql there is the number of returned lines at the
> end.
> Is this also, if I do a query via jdbc and can I access this number
> before I process the results??

Not before you process the results.

This is an age old question with JDBC (includes why there isn't a standard
way of going backwards in a ResultSet - I haven't looked at the JDBC 2
spec but it may be in there...).

The problem is that most databases don't know how many rows are to be
returned to the client, until they have finished sending it.

It's basically a performance thing.

The only way to know how many are returned is to count the results your
self while reading the ResultSet.

--
Peter T Mount peter@retep.org.uk or petermount@earthling.net
Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres


В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Oleg Bartunov
Дата:
Сообщение: Re: [INTERFACES] How translate KOI-8 to Win1251 whith PsqlODBC
Следующее
От: "Þórður Ívarsson"
Дата:
Сообщение: How to get correct alphabetical order