struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geeta Ramani" <>
Subject RE: Multiple Databases.
Date Thu, 20 May 2004 12:51:31 GMT

If you are using tomcat, then I believe you can use dbcp. (I think that's what Riyad Kalla
was talking about too..) We use dbcp but only for connecting to one pool (and this turned
out to be quite simple: just configure the server.xml), but I think I read that you can create
multiple pools, which seems to be what you need. (My guess is you add more <Resource elements
in your particular context in the server.xml and give all the db info in the corresponding
ResourceParams.. Like I said, i haven't doene this with multiple databases, but seems like
the machinery is there..

This article contains a link with an example and a "How to tell tomcat to use dbcp" piece:

And here's a detailed how-to:


> -----Original Message-----
> From: Vishal Arora []
> Sent: Thursday, May 20, 2004 1:22 AM
> To: Struts Users Mailing List
> Subject: Re: Multiple Databases.
> well  that not the problem  but my problem is that i want to 
> connect to
> different databases  in my application and i m using 
> datasource object  and
> in my xml file i have given the details of my database
> url,username,password  etc etc. but now i want to connect to another
> database and if in struts-config.xml i give information abt 
> other database
> .but when in my controller when i will give call to my 
> datasource object to
> which database the connection will be made and how can i handle
> if i want to make connection to Database A and after 
> sometime in
> the same file if i want to make connection to DatabaseB how 
> will it work and
> what all changes i will have to make.and where. Pleaseif 
> anybody can provide
> an example it will be very helpfull.
> Thanks.> 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message