X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id F0BAE53221 for ; Fri, 15 Apr 2005 17:04:19 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 40956-06 for ; Fri, 15 Apr 2005 20:04:11 +0000 (GMT) Received: from mail63.csoft.net (leary3.csoft.net [63.111.22.74]) by svr1.postgresql.org (Postfix) with SMTP id 267DC53215 for ; Fri, 15 Apr 2005 17:04:07 -0300 (ADT) Received: (qmail 32045 invoked by uid 1112); 15 Apr 2005 20:04:06 -0000 Date: Fri, 15 Apr 2005 15:04:06 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: David Gagnon Cc: pgsql-jdbc@postgresql.org Subject: Re: Getting the number or row returned by a select. Alway In-Reply-To: <42601BBD.6060307@siunik.com> Message-ID: References: <20050414154508.66799.qmail@web50407.mail.yahoo.com> <425EE184.8060303@opencloud.com> <42601BBD.6060307@siunik.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.012 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/92 X-Sequence-Number: 12699 On Fri, 15 Apr 2005, David Gagnon wrote: > So did I miss something obvious. Is it possible to get the total number > of row returned from a query without doing another select. > Anytime you've got the results of a query you can loop over it to count the number of elements. In JDBC with a scrollable ResultSet you may issue rs.last() and rs.getRow() to get the number of rows. rs.beforeFirst() will then reset the ResultSet back to its original state. Kris Jurka