This content has been marked as final.
Show 3 replies
-
1. Re: how to config one database for serveral datasources?
jali Jan 10, 2007 12:11 AM (in response to jali)maybe i need to commend it clearly.
in my mysql. there are three databases(A?B?C),i want to use them at the same time in my current system. how to config it in jboss. -
2. Re: how to config one database for serveral datasources?
kaobe Jan 10, 2007 3:42 AM (in response to jali)Hi,
either you define n *-ds.xml files, each defining one database connection, or you use one -ds.xml file that defines the n connections to the database. Inside the datasources tag you can define n datasources.
Peter -
3. Re: how to config one database for serveral datasources?
jali Jan 10, 2007 11:11 PM (in response to jali)"kaobe" wrote:
Hi,
either you define n *-ds.xml files, each defining one database connection, or you use one -ds.xml file that defines the n connections to the database. Inside the datasources tag you can define n datasources.
Peter
thanks for your reply.
this is my mysql-ds.xml in the folder of the default deploy.
but i don't know how to config standardjbosscmp-jdbc.xml file because in this file there is only one default property "datasource". how to set three databases.
standardjbosscmp-jdbc.xml:
.....
java:/A
<datasource-mapping>mySQL</datasource-mapping>
......
mysql-ds.xml:
<local-tx-datasource>
<jndi-name>A</jndi-name> <connection-url>jdbc:mysql://localhost:3306/A</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>root</user-name>
</local-tx-datasource>
<local-tx-datasource>
<jndi-name>B</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/B</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>root</user-name>
</local-tx-datasource>
<local-tx-datasource>
<jndi-name>C</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/C</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>root</user-name>
</local-tx-datasource>