• 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic