|
 |
pro_jsp thread: help required on resultset
Message #1 by Prashant Vasha <prashantvasha@g...> on Wed, 6 Sep 2000 17:01:14 +0530
|
|
He has to write
if (rs!=null)
{
}
> ----------
> From: PETER BALMFORTH[SMTP:peter.balmforth@n...]
> Sent: Thursday, September 07, 2000 2:42 PM
> To: Pro_JavaServer_Pages
> Subject: [pro_jsp] Re: help required on resultset
>
> In fact I think the test for (rset == null) is completely unneccessary.
> A results set is always returned but may not contain any results.
>
> Best regards,
>
> Peter Balmforth
>
> Net-Commerce
> Unit 3, Cromwell Park, Banbury Road, Chipping Norton, Oxon OX7 5SR
>
> tel: +44 (0) 1608 646505
> fax: +44 (0) 1608 646623
> e-mail:<mailto:peter.balmforth@n...>
> web: <http://www.net-commerce.co.uk/>
>
> This e-mail transmission is strictly confidential and intended only for
> the
> use of the person or organisation to whom it is addressed. The views
> expressed in this communication are not necessarily those held by Cassium.
> It may contain privileged and confidential information and, if you are not
> the intended recipient, you must not copy, distribute or take any action
> that relies on the accuracy of the information contained.
>
> If you have received this e-mail in error, please e-mail
> enquiries@c... by return or telephone 44 20 8843 8100.
>
>
>
> -----Original Message-----
> From: Ljubisa Kovacevic [mailto:LubisaK@H...]
> Sent: 07 September 2000 06:23
> To: Pro_JavaServer_Pages
> Subject: [pro_jsp] Re: help required on resultset
>
>
> Hi,
>
> Probably, I could help you with this, if you specify closer your problem.
> I don't understand, what's the problem if your program doesn't display
> data
> if there is not rows in result set. It's normal, and only you need to pay
> attention do not cause InvalidPointerException (or so) if you are try to
> access nonexisting row within result set. In other words you need to
> include
> in display logic following:
> if(rset == null){
> give message
> }else{
> while(rset.next()){
> display the data
> }
> }
> While loop above will iterate over ResultSet.
>
> I'm not positive that understand what you mean with
> > another problem i m facing is that i want to traverse thru the
> resultset.
> > but i dont know which property of the resultset is to be set to true for
> the
> > same.
> What properties are you talking about?
> cheers
> ljubisak
>
> .
>
>
> ----- Original Message -----
> From: Prashant Vasha <prashantvasha@g...>
> To: Pro_JavaServer_Pages <pro_jsp@p...>
> Sent: Wednesday, September 06, 2000 4:31 AM
> Subject: [pro_jsp] help required on resultset
>
>
> > i m trying to retrieve some records from the database table.
> > i m giving the following condition to check whether the resultset is
> > populated with rows or no:
> > if(rset == null){
> > give message
> > }else{
> > display the data
> > }
> > if the resultset is populated with rows, it is displaying the data. but
> if
> > there are no rows in the resultset then it is not displaying the data.
> > another problem i m facing is that i want to traverse thru the
> resultset.
> > but i dont know which property of the resultset is to be set to true for
> the
> > same.
> > can some one help me with the same.
> > regards
> > Prashant Vasha
> > Systems Engg.
> > Global Tele Systems Ltd.
> > Mahape
> > Phone: 7612929/7684111 ext.: 2186
> >
>
>
> ---
> Do you know what you want from this list? How would you provide
> programmers with the solutions they need? If you have the answers, and are
> willing to work in Birmingham (UK), then you could be a List Manager.
> Please send CVs and a covering letter to listsupport@p... for
> further information.
>
|
|
 |