Re: numrows - Mailing list pgsql-jdbc

From Dave Cramer
Subject Re: numrows
Date
Msg-id 1040342366.20210.52.camel@inspiron.cramers
Whole thread Raw
In response to numrows  (Ricardo Javier Aranibar León<ricardo_jal@hotmail.com>)
Responses Re: numrows  (Jeremy Buchmann <jeremy@wellsgaming.com>)
List pgsql-jdbc
Ricardo,

There's no way after the fact other than counting them, ie scrolling
through them and keeping track.

However for simple selects you can do

select count(*), * from user where id=3

and count will contain the count.

Dave
On Thu, 2002-12-19 at 17:04, Ricardo Javier Aranibar León wrote:
> Hi list,
>
> How I can figure out the number of rows from the query?
> For example:
> String q1= "Select * from user where id=3";
> PreparedStatement ps = conex.prepareStatement(q1);
> ResultSet rs = ps.executeQuery();
>
> //Now how i can to know the number of rows from select?
>
> REgards,
> Ricardo
>
>
>
>
> _________________________________________________________________
> MSN Fotos: la forma más fácil de compartir e imprimir fotos.
> http://photos.msn.es/support/worldwide.aspx
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
--
Dave Cramer <Dave@micro-automation.net>


pgsql-jdbc by date:

Previous
From: Ricardo Javier Aranibar León
Date:
Subject: numrows
Next
From: Jeremy Buchmann
Date:
Subject: Re: numrows