Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multiple JDBC Connections via Hibernate

 
Zak Nixon
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have 3 databases. I am in need of connecting to them
with Hibernate. How can I set up my application to have
multiple hibernate.properties?

Zak
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need seperate Properties, Configuration and SessionFactory objects for each DB. So you will have to configure each manually, getting the appropriate hibernate.properties for each one explicitly i.e. delete the default files and configure the app programmatically. Make sense?
 
Zak Nixon
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I understand now.

This topic helped:
topic

Thanks

Zak
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic