> At 11:00 22/07/2002 +0000, you wrote:
>hi all,
>
>I am creating a database backed servlet driven application. Ive created a
>database connection pool which has been placed into the application object
>(ServletContext) so servlets can each get a connection by calling
>getServletContext.getAttribute("dbPool").
>
>Ive created java helper classes/beans which i would like to use within the
>servlets. The problem im having is that these classes require database
>access from the pool.
>
>Is there any way to access the ServletContext / application object within
>the java helper classes so i can get at the connection pool??? The only
>way i can think of getting around it is by passing a ConnectionPool object
>in as a formal parameter when i call the class from the servlet.
>
>any input appriciated.
>---
>Change your mail options at http://p2p.wrox.com/manager.asp or
>to unsubscribe send a blank email to
As you guessed you must pass the pool as a parameter, or alternatively you
can make the pool a singleton object and retrieve it through a static
method like PoolClass.getInstance()
hope it helps,
Giovanni
----------------------------------------
Giovanni Cuccu
Sw Engineer@d...
Dianoema S.p.A.
Via de' Carracci 93 40131 Bologna
Tel: 051-4193911
e-mail:gcuccu@d...
----------------------------------------
giovanni,
thats it, thanks for your help.