You should be able to set up multiple database connections in server.xml; I
don't see why there's a problem.  As long as you're using unique names for
the resources, you should be OK.  BTW, a "standard" for naming such things
would be "com.mycompany.myapp.Constants.DATABASE_KEY" -- not likely to ever
step on someone else's resource name that way.

I have a Tomcat instance with two separate dbcp pools set up now, where one
application uses one of them, the another uses the other, and everything is
happy.

----- Original Message -----
From: "Johan Wasserman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 26, 2003 3:40 AM
Subject: [newbie]dbcp pools with Struts... the saga continues


Hi,
This might me out of context, but please be patient with me.

I am now building a DAO (thanks for putting me on the right track Mr.
Graham) and I'm trying to find a way for the DAO to establish it's own
connection to the database pool/s created by the ActionServlet.
Again, I must stress that I am very new to struts and dbcp.  I would
prefer not to pre-established connection (using getConnection) and
passing that to the DAO, and I believe the method I'm trying to use
below should be helpful in a lot of other circumstances as well.

I know that would be very easy if my pool/s where configured in
server.xml and then would be accessable through initialContext.  But
being configured in strust-config (servlet context) I cannot set up a
<resource-ref> for it in web.xml.  (in servlet and not container
context, because multiple companies share the same web-server, but have
their own app connecting to their unique db instance).


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to