Hi all, Currently in my project i have CMP beans which have all access to the databse at a specified location.But the problem is that one module require to access data from a different DB.Can i use CMP to access that if so how should i specify that CMP alone to access the other database.One option i am confident of is that i can model it as BMP and make a connection and handle transaction as well with user transaction.
gusy please suggest some ideas to access it with CMP.
How about deploying the same EJBs with two different databases, your code doesn't change you just need to deploy the same EJB(s) pointing to different DB.
Joined: Jan 19, 2004
hi , Guys i think my previous question is confusing.I am making my question as simple as possible.?? please answer
I just need to find how to configure a CMP bean to point to one database and another CMP bean with in the same applicaiton to another database.
In conf directory i have this config standardjbosscmp-jdbc.xml <defaults> <datasource>java:/MySQLDS</datasource> <datasource-mapping>mySQL</datasource-mapping> -- -- </defaults>
in deploy directory i have mysql-ds.xml as <local-tx-datasource> <jndi-name>MySQLDS</jndi-name> <connection-url>jdbc:mysql://localhost:3306/db</connection-url> <driver-class>com.mysql.jdbc.Driver</driver-class> <user-name></user-name> <password></password> </local-tx-datasource>
One DB is mysql .
I need to connect to another DB which might be any .Can any one give ideas how to add the configuration information for other db so that my other CMP looks out for that.
Put it another way how to tell to CMP to look to a different database.
Joined: Feb 11, 2004
Did u try explicity mentioning your <resource-ref> in the ejb-jar.xml