Vishal:

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:
http://www.midrangeserver.com/mpo/mpo081502-story04.html

And here's a detailed how-to:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html

Regards,
Geeta

> -----Original Message-----
> From: Vishal Arora [mailto:[EMAIL PROTECTED]
> 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
> it..like 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to