<snip from="http://jakarta.apache.org/struts/faqs/database.html">
If you need more than one data source in a module, you can include a key attribute in the data-source element: <data-sources> <data-source key="A" type="org.apache.commons.dbcp.BasicDataSource"> ... properties as before ... </data-source> <data-source key="B" type="org.apache.commons.dbcp.BasicDataSource"> ... properties as before ... </data-source> ... </data-sources> Which can then be accessed by including the key ("A" in this case) as an additional parameter to the Action.getDataSource() method. ... try { dataSourceA = getDataSource(request, "A"); dataSourceB = getDataSource(request, "B"); ... Each module can have as many data sources as it needs. The keys only need to be unique within a module since the struts module system maintains a name space for the items in each module to protect you from name clashes. </snip> -- Andrew Kuzmin http://www.java201.com >----- Original Message ----- >From: "virupaksha" <[EMAIL PROTECTED]> >To: "Struts Users Mailing List" <[EMAIL PROTECTED]> >Sent: Friday, September 19, 2003 6:26 AM >Subject: Data Source in struts-config.xml >Dear All, >I need to connect to two different databases,MS Access & MYSQL. >I am connecting databases using JNDI lookup,so to connect using JNDI lookup i need to give database name in my code. >Can any one help me how i can configure two datasource name in struts-config.xml. >Waiting for ur help... >Regards, >viru --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]