Sorry, this is bit off topic but what is a "Newbie Delamere" ??

Regards Michael Delamere :-)


----- Original Message -----
From: "Gary Helmling" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Thursday, May 30, 2002 2:26 PM
Subject: Re: Having a Newbie Delamere here.


> In some of your code sections, you're trying to accessing values before
> advancing the ResultSet to the first row.  For example, you have:
>
>   stmt = conn.createStatement();
>   rs = stmt.executeQuery(sQuery);
>
>   // Assign values from the database
>   sSubTitle = rs.getString("SubTitle");
>   sFormName = rs.getString("FormName");
>   sContent = rs.getString("Content");
>
> try wrapping this in a call to rs.next():
>
>   if (rs.next())
>   {
>     // Assign values from the database
>     sSubTitle = rs.getString("SubTitle");
>     sFormName = rs.getString("FormName");
>     sContent = rs.getString("Content");
>   }
>
> Also, it's usually better to package this kind of functionality in a
> JavaBean, which you can then instantiate and use in your JSP.  This
> leaves your JSP code much cleaner and more readable, and allows you to
> do more advanced things like caching values between identical requests
> (like page refreshes).
>
> --g
>
> On Thu, 2002-05-30 at 03:21, Nicholas Orr wrote:
> > Again coming from the ASP world of doing things.
> > in ASP you can open a connection to a Database (DB) and execute a bunch
of
> > queries and do whatever you need to then after you have finished close
the
> > connection.
> >
> > Now I have tried to do this in jsp, but not having much luck.  Keep
getting
> > 'Result set type is TYPE_FORWARD_ONLY'
> >
> > Cause In ASP when you start a new ResultSet, after you have closed the
> > previous one, (asp equiv = recordset) It automatically goes back to the
> > begining as it should, but in jsp it seems to just hang around at
rs.last().
> >
> > !I don't know!
> >
> > Well if you could help, I would appreciate it, Source included.
> >
> > Regards,
> >
> > Nicholas
> >
> >
> >
> >
> > **********************************************************************
> > The information contained in this e-mail is confidential and is
> > intended only for the use of the addressee(s).
> > If you receive this e-mail in error, any use, distribution or
> > copying of this e-mail is not permitted. You are requested to
> > forward unwanted e-mail and address any problems to the
> > MIM Holdings Limited Support Centre.
> >
> > For general enquires: ++61 7 3833 8000
> > Support Centre e-mail: [EMAIL PROTECTED]
> > Support Centre phone:  Australia 1800500646
> >         International ++61 7 38338042
> > **********************************************************************
> >
> > ----
> >
>
> > --
> > To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to