• 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
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!