n to do "select
count(*)..." would be the option I would go with.
Anand
-Original Message-
From: Manuel Rodriguez Diaz [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 29, 2002 1:00 PM
To: Tomcat Developers List
Subject: Re: ResultSet
Thankyou.
I've just tried this.
In fact i
Thankyou.
I've just tried this.
In fact i write a select count(1) which is faster (for a reason i don't know).
The problem is that in many cases i have a group clause that cause problems with
this method.
So i thought this:
resultset= statement.CreateQuery();
resultset2= resultset;
Obviously, bo
have you tried getting the row count from the db instead of looping
yourself?
this approach will offload a few resources (counting) back to the db
(assuming its tiered) where it belongs(IMHO)
//assuming your db supports count() [duh]
//if you build your sql in chunks
String sqlSelect = "Select C
If you want to compare String objects as literals, use the intern() method.
Micael
At 03:58 PM 3/11/02 +0700, you wrote:
>Hi,
> For the brave, can anyone guess why with this rather unsociable code:
>
>
> if ((res.getString(3) == null) || (res.getString(3) == "")) {
>out.println("re
Try to do this:
if ((res.getString(3) != null) && (res.getString(3).length > 0))
{
...
}
It is because java.util.String must use its equals() method for string
comparison. The only logical operator you can use is for null
comparison.
Also some database distinguish betwee