If your connection pool is a Singleton, and its "get/set" connection methods
are static, any servlet that is running in your servlet engine's VM can
access the pool.
For example, if my connection pool is called MultiPool (which it is), I
could call MultiPool.getConnection() from any of my servlets to get a
connection.
This is because each servlet will try to instantiate a new instance of
MultiPool in their init() method. But, since MultiPool is a singleton, it
only ever creates _one_ instance of itself, and then simply returns a
reference to that single instance to all of the other servlets that call its
constructor.
Shad
--
Shad J. Aumann
190 Earle Drive
North Kingstown, RI 02852
[EMAIL PROTECTED]
> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Eric
> Lim
> Sent: Thursday, September 02, 1999 6:51 AM
> To: [EMAIL PROTECTED]
> Subject: Global ConnectionPool Servlet
>
>
> Does anyone know how we can implement a Global JDBC Connection
> pool in JSDK
> 2.1 after the getServlet() method is removed??..
> This pool is supposed to be shared by all the servlets. I used to call
> getServlet() to get a reference to the DBServlet and then invoked the
> getConnection() method to get a free JDBC connection. But how do i achieve
> this with RequestDispatcher????
>
> Cheers
> Eric
>
> __________________________________________________________________
> _________
> 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