• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Configuring Multiple Databases in hibernate.

 
Thillai Sakthi
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Need your help.
My application connects to two databases. I am using hibernate for this. I have connected successfully to one database in hibernate.cfg.xml file. I have tried querying the tables and all is working fine.
But I dont know how to configure for another database....How do I configure the other database in this xml itself?
Or A separate config file is required? What should be the name of that file?

Pls throw some more insights into it.....

Thanks in advance,
Shakthi
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to use two Configurations and two SessionFactories. (Which would mean you'd have to load the configuration manually, rather than using the default hibernate.cfg.xml route)
[ June 18, 2004: Message edited by: Paul Sturrock ]
 
Thillai Sakthi
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, Thanks, I figured that out.....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic