How about construct a faceless servlet,i.e. GenericSerlet, preload it and
initialize the connection pool and store it as a static member of a class.
The subsequent servlet just call a method of this class, be it static or
non static. In this case you do not need ServletContext.
Bing
At 08:41 PM 6/9/99 +0100, you wrote:
>What about the following:
>
>The first time DbServlet is called, get the ServletContext and assign it to
>a static variable. Also create a public static method in DbServlet to return
>the ServletContext. Any class could then retrieve the SessionContext.
>
>Not sure if this is the best way of doing it, but hope it helps.
>
>Stephen Baishya
>
>----- Original Message -----
>From: tmueller <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Tuesday, June 08, 1999 10:13 PM
>Subject: Connection Pooling Servlet
>
>
>> Hello all,
>>
>> Im writing a servlet (DbServlet) that uses the DbConnectionBroker as
>> explained in chapter 9 pg. 266 of the Jason Hunter (O'Reilly) book that
>will
>> hand off connection objects.
>>
>> The problem is that the classes of another servlet cannot use
>> getServletContext() to get the reference to the DbServlet
>> since the classes have no servlet context of thier own.
>>
>> So my question is : Is there a way to get to the DbServlet with out having
>> to hand out the ServletContext to every class
>> and the classes they use?
>>
>> Thanks in advance.
>>
>>
>___________________________________________________________________________
>> 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