"Loganathan, Kamalesh" wrote:

> My application is a reporting & monitoring application. Personally, I don't
> want to use any database related classes in jsp page. Instead, I would like
> to create report (wrapper ?) beans and use them in the page.  But, should I
> create a bean for each row (entity) or use a manager bean as wrapper class
> for resultset ??
>
> Any comments ??
>

If you are using the ResultSet, either directly or indirectly via a wrapper bean,
there are some implications:

* The ResultSet must remain open (potentially across multiple
  requests if you allow the user to scroll forwards and backwards
  by pages like a search engine does).

* Therefore, the Statement from which this ResultSet was created
  must remain open.

* Therefore, the Connection from which this Statement was created
  should remain exclusively allocated to this user (to avoid problems
  with transactional commits and rollbacks affecting the results).

On the other hand, if you create business object beans to represent your results,
you can close the ResultSet and Statement, and return the connection to your
connection pool, as soon as the query completes.  This can substantially increase
the number of users your application can support with a given number of
connections.

Craig McClanahan

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to