Re: JDBC: Fast way to find the number of rows in a ResultSet?



Philipp Taprogge wrote:
I think there is a slightly better way... it's still not elegant, but it
should work:

result.last();
int rowcount = result.getRow();
result.beforeFirst(); //to reset the resultset for later use.

To do that the ResultSet would likely need to be scrollable
and that will cause many JDBC drivers to read all data
into memory. So this solution works best with small data.

Arne
.



Relevant Pages

  • Re: Damn you, FEDEX! or Nikon D40 lost in Springfield, MO blackhole.
    ... the 2 mp Mavica he had been using with a Nikon D40. ... After shopping around, he got me to order one for him. ... The shipper had it insured, but from what I have read it could take weeks to sort this crap out. ... You may get your insurance from FedEx and a couple weeks later they find it and deliver it. ...
    (alt.photography)
  • Re: Database notification
    ... >> JDBC drivers provide anything that may support this? ... > the client side. ... can use TYPE_SCROLL_SENSITIVE when creating the statement for the resultset. ... * FirstSQL/J Object/Relational DBMS ...
    (comp.lang.java.databases)
  • Re: The Sci-Fi Rejection Letter That Time Forgot
    ... nations have stockpiled arsenals of these incredible bombs and the time the story is set. ...
    (rec.arts.sf.written)
  • RE: copied music cds have a skip in last 18 seconds
    ... If installing all missing Windows Updates doesn't fix your problem ... xiowan.......in tucson ...
    (microsoft.public.windows.mediacenter)