• Post Reply Bookmark Topic Watch Topic
  • New Topic

Connecting Multiple database using Hibernate

 
Pushkal Sharma
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am making insurance management system and i am using struts and hibernate capabilities but I am facing a problem with connecting multiple database using hibernate in myeclipse.Can anybody tell me how to connect multiple database using hibernate?Please


Thanks in advance!!
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy Greenhorn!

You can set up multiple session factories and give them a different hibernate config file. So, you might have hibernate_ora.xml and hibernate_db2.xml.

Then, each session will give a connection to a different database.

If more complex associations are needed, there is a Hibernate project called Shards that is designed just for this purpose. You can fine out more about it at hibernate.org.

-Cameron McKenzie
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!