Re: MySQL ResultSet - count rows?
- From: "tzvika.barenholz@xxxxxxxxx" <tzvika.barenholz@xxxxxxxxx>
- Date: Tue, 11 Dec 2007 06:45:08 -0800 (PST)
On Dec 10, 10:34 am, Christoph <christoph.bursc...@xxxxxxxxx> wrote:
Hello,
I am writing the data of a ResultSet object to an array. To declare
the array length, I need to know the number of rows before copying
them - is there a way to read the row count instantly, without having
to iterate anything?
PHP has mysql_count_rows, but I'm not sure what that does internally -
it may just iterate over the data too.
--
Chris
How about initing a CachedRowSet object from your result set? (http://
java.sun.com/j2se/1.5.0/docs/api/javax/sql/rowset/CachedRowSet.html)
you could then avail yourself of the size() method - and with just a
single pass.
T
.
- References:
- MySQL ResultSet - count rows?
- From: Christoph
- MySQL ResultSet - count rows?
- Prev by Date: What does everyone else do for graphically displaying data?
- Next by Date: Re: What does everyone else do for graphically displaying data?
- Previous by thread: Re: MySQL ResultSet - count rows?
- Next by thread: What does everyone else do for graphically displaying data?
- Index(es):
Relevant Pages
|
|