pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
JDBC line count in query result
2+ messages / 2 participants
[nested] [flat]

* JDBC line count in query result
@ 1998-08-04 07:16  Bernhard Ertl <ertl@edupsy.uni-muenchen.de>
  0 siblings, 1 reply; 2+ messages in thread

From: Bernhard Ertl @ 1998-08-04 07:16 UTC (permalink / raw)
  To: pgsql-sql@postgreSQL.org <pgsql-sql@postgreSQL.org>; pgsql-interfaces

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??

Bernhard




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [INTERFACES] JDBC line count in query result
@ 1998-08-04 17:48  Peter T Mount <peter@retep.org.uk>
  parent: Bernhard Ertl <ertl@edupsy.uni-muenchen.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter T Mount @ 1998-08-04 17:48 UTC (permalink / raw)
  To: ertl@bigfoot.com; +Cc: pgsql-sql@postgreSQL.org <pgsql-sql@postgresql.org>; 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




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~1998-08-04 17:48 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-08-04 07:16 JDBC line count in query result Bernhard Ertl <ertl@edupsy.uni-muenchen.de>
1998-08-04 17:48 ` Peter T Mount <peter@retep.org.uk>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox