File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss and the fly likes How to use multiple DataSources in a JBoos AP ? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Products » JBoss
Reply Bookmark "How to use multiple DataSources in a JBoos AP ?" Watch "How to use multiple DataSources in a JBoos AP ?" New topic
Author

How to use multiple DataSources in a JBoos AP ?

Eduardo F. Sandino
Greenhorn

Joined: Dec 10, 2009
Posts: 7
Hi there... folks... i am in a big dilema i need to use two databases from my project.
One in Oracle the other in MySQl. and the problem is that the Oracle's ones should have the user and roles. Please anyone there could give me good advices in how to manage this in my jboss seam web project ?

thanks...
Jaikiran Pai
Saloon Keeper

Joined: Jul 20, 2005
Posts: 6564

JBoos AP? I guess you mean JBoss AS.

i am in a big dilema i need to use two databases from my project.
One in Oracle the other in MySQl.


You will have to create 2 datasources. Maybe this previous discussion will help

[My Blog] [JavaRanch Journal]
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 4489

After creating your two *-ds.xml files, then:

a) Configure a DatabaseServerLoginModule in login-config.xml to reference the Oracle database.

b) For a web app I would say to configure web.xml and jboss-web.xml to use the login module from step a). But I am not sure where that configuration would go in Seam.

c) Configure Hibernate to use the MySQL database.

At least, I hope it is that simple and that Seam doesn't require some additional/alternate configuration.


JBoss In Action
Eduardo F. Sandino
Greenhorn

Joined: Dec 10, 2009
Posts: 7
Thanks for the help...

Peter Johnson wrote:After creating your two *-ds.xml files, then:

a) Configure a DatabaseServerLoginModule in login-config.xml to reference the Oracle database.

b) For a web app I would say to configure web.xml and jboss-web.xml to use the login module from step a). But I am not sure where that configuration would go in Seam.

c) Configure Hibernate to use the MySQL database.

At least, I hope it is that simple and that Seam doesn't require some additional/alternate configuration.
 
 
subject: How to use multiple DataSources in a JBoos AP ?
 
MyEclipse, The Clear Choice