Adam Buglass wrote:
This is the wrong list but never mind
An alternative is the following:
ResultSet rs;
int i = 0;
while( rs.next() ) {
i++;
}
The integer i should be the length of your result set (by the way, don't
get confused with RecordSets which are VB - I used to do that all the
Adam Buglass wrote:
This is the wrong list but never mind
An alternative is the following:
ResultSet rs;
int i = 0;
while( rs.next() ) {
i++;
}
The integer i should be the length of your result set (by the way, don't
get confused with RecordSets which are VB - I used to do that all the
==
Date: 20 May 2004 17:45:23 +0100
From: Adam Buglass [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Subject: RE: Is there any way to check # of Records in RecordSet
==
I was just surprised because I've never run into that
This is the wrong list i'm pretty sure but there are a couple of ways to get the
number but there isnt a direct method that returns it.
If the result set is scrollable you can iterate through it counting the number of
iterations, then set it back to the start when you want to process the
This is the wrong list but never mind
An alternative is the following:
ResultSet rs;
int i = 0;
while( rs.next() ) {
i++;
}
The integer i should be the length of your result set (by the way, don't
get confused with RecordSets which are VB - I used to do that all the
time!) at the end of
ResultSet rs;
int i = 0;
while( rs.next() ) {
i++;
}
If the cursor is non scrollable, this will only work once.
It is better for you to execute a Select count(1) ... query, to find out how many
results you would get back. Or even better,
execute a stored procedure that returns the count as an
On Thu, May 20, 2004 at 03:26:25PM +0100, Dale, Matt wrote:
: This is the wrong list i'm pretty sure but there are a couple of ways to get
: the number but there isnt a direct method that returns it.
:
: If the result set is scrollable you can iterate through it counting the number
: of
Thanks Adam :)
First of all I subscribe to the list yesterday and I m
new to JSP. Secondly could u plz tell me right list
name so I can subscribe to that.
Adam, I did exactly the same way u mentioned, but when
I use like
//---
ResultSet rs = stmt.executeQuery(query);
The first code will work if when you create your statement object you define it as
scrollable.
Statement stmt =
con.createStatement(
ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
-Original Message-
From: soh_mah
first code = result set not scrollable, you can only loop through it once
Filip;
- Original Message -
From: soh_mah [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Thursday, May 20, 2004 9:50 AM
Subject: RE: Is there any way to check # of Records in RecordSet
Thanks
Please dont use for other than stated purpose of the list. I hope you
understand that.
-Original Message-
From: soh_mah [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 20, 2004 10:50 AM
To: Tomcat Users List
Subject: RE: Is there any way to check # of Records in RecordSet
Thanks Adam :)
First of all forgive me for being very stressed and tired - All I did
was put into some kind of code model a suggestion previously put forward
by Matt:
If the result set is scrollable you can iterate through it counting
the number of iterations, then set it back to the start when
you want to
Adam - I mentioned this in another post but unless the result set is scrollable then
you can't reset it back to the beginning. You need to declare the statement object as
scrollable when you create it to achieve this. So Filip was right in that it will only
work once with the default behaviour.
On Thu, 2004-05-20 at 16:38, Dale, Matt wrote:
Adam - I mentioned this in another post but unless the result set is scrollable then
you can't reset it back to the beginning. You need to declare the statement object
as scrollable when you create it to achieve this. So Filip was right in that
14 matches
Mail list logo