Typically you bind a DataSource into jndi
which is a pool of connections to the database.
There is nothing to stop you creating two DataSources
with different jndi names for the same database.
You can map the beans to datasources using
resource references or resource managers in jboss.xml
Be careful with commit-option if you are accessing
the same tables.
I'm an EJB newbie... so I would be very grateful if you could help me out with a little more detail about how I achieve this. I'm using JBuilder7 as my IDE.
To date I've copied the 'mysql-service.xml' file into the 'server/default/deploy/' folder and set this config file so that it points at a specific mySQL database 'test01', like...
Now I have another prototype bean I have developed that exists in a second mySQL database called 'test01'. How and where do I define the link to this second database?
Ok... I'm a EJB/JBoss newbie... how would I go about doing this?
So far I have deployed the 'mysql-service.xml' file into the 'deploy' folder. This xml file includes definitions that point to a 'test01' mySQL database.
I now want to create a new link that allows CMP2.0 entity beans to use a second mySQL database called 'test02'. How and where do I setup the links to this second database?
For the test02
you just create a mysql2-service.xml
For the beans:
You'll find the dtd in docs/dtd
look for datasource
Something like or whatever jndi names you use:
You can also set it in at the top of the xml.