• Post Reply Bookmark Topic Watch Topic
  • New Topic

Connecting two different databases in same java session

 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

someone please assit me how to connect two different databases in same java session.

1. Is it possible from Pojo (Standalone Java service)
2. Is it Possible from MDB or EJB.
3. Spring, Hibernate..

Please assist me what are the possible ways and the best solution...
 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to JDBC.
 
xsunil kumar
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what do you mean by java session here. Is it web application session or any thing else. By using Hibernate you can connect it. You need to create more than one hiberante config.xml file with connection parameters.

 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How abouts EJB's ?
 
xsunil kumar
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have not much idea about EJB's but if you are using EJB with JPA then you need to google out. Are you Gaurav Singh.

-Sunil
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35709
408
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Meet,
If you use two different datasources, you can connect to two databases. You would use an XA driver to have a distributed transaction.

Moving to our EJBs forum.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!