Re: numrows

From: Dave Cramer <Dave(at)micro-automation(dot)net>
To: Ricardo Javier Aranibar León <ricardo_jal(at)hotmail(dot)com>
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: numrows
Date: 2002-12-19 23:59:26
Message-ID: 1040342366.20210.52.camel@inspiron.cramers
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)postgresql(dot)org)
--
Dave Cramer <Dave(at)micro-automation(dot)net>

In response to

  • numrows at 2002-12-19 22:04:04 from Ricardo Javier Aranibar León

Responses

  • Re: numrows at 2002-12-20 00:17:40 from Jeremy Buchmann

Browse pgsql-jdbc by date

  From Date Subject
Next Message Jeremy Buchmann 2002-12-20 00:17:40 Re: numrows
Previous Message Ricardo Javier Aranibar León 2002-12-19 22:04:04 numrows