"Radhakrishnan, Sanjay (c)" wrote:

> I am trying to set up a connection pool for my JSP Project. Now I know that
> there are few ways to implement a connectionpool.  My first thought was to
> put in the the servlets init method,But then what do i do for my other
> servlets/JSPs, do i create a connectionpool for every servlet?.
>
> Is there a standard technique for implementing connection pools.  I think
> the best solution would be to have it in a common place which all the JSPs
> and servlets can access, something like a global.asa file in ASP.
>

The most useful place I've found to put a connection pool is as a servlet context
attribute.  Now, it is accessible from a servlet:

    ConnectionPool pool = getServletContext().getAttribute("pool");

or from a JSP page:

    <jsp:useBean id="pool" scope="application" class="...."/>

as long as the servlets and JSP pages belong to the same web application.

>
> I would like to hear your thoughts on this.
>
> Thanks for your time
> Sanjay
>

Craig McClanahan

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to