if (rs.next()) {
initialize variables etc.
load the first row..
while(rs.next()) {
load the other rows...
}
}else {
no result
}
i think firing two queries is avoidable..
> -----Original Message-----
> From: Kevin Jones [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, September 05, 2000 6:27 AM
> To: [EMAIL PROTECTED]
> Subject: Re: checking Empty-ResultSet
>
> You could always do a "SELECT COUNT (*)" SQL query first, this will tell
> you
> how many rows you will get back then run the 'real' query if the answer is
> >
> 0
>
> Kevin Jones
> DevelopMentor
> www.develop.com
>
> > -----Original Message-----
> > From: A mailing list for discussion about Sun Microsystem's Java Servlet
> > API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
> > Rajesh_Singh
> > Sent: 29 August 2000 12:29
> > To: [EMAIL PROTECTED]
> > Subject: checking Empty-ResultSet
> >
> >
> > Hi friends
> > i'm sorry but this question i'm repeating
> > here after a long time as i'm finding it difficult
> > to solve...How to Check whether ResultSet is
> > empty..?...as if it is empty then on executing the
> > statement resultset.next()...it throws an execption..so how
> > to check it....
> > Please let me know if any of u have any suggestion....
> > will appreciate ur response..
> >
> > thanx
> > Rajesh
> >
> > __________________________________________________________________
> > _________
> > To unsubscribe, send email to [EMAIL PROTECTED] and include
> > in the body
> > of the message "signoff SERVLET-INTEREST".
> >
> > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > Resources: http://java.sun.com/products/servlet/external-resources.html
> > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
> >
> > __________________________________________________________________
> > _________
> > To unsubscribe, send email to [EMAIL PROTECTED] and include
> > in the body
> > of the message "signoff SERVLET-INTEREST".
> >
> > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > Resources: http://java.sun.com/products/servlet/external-resources.html
> > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> __________________________________________________________________________
> _
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html