-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: How to connect two databases to hibernate?
PostPosted: Fri Mar 25, 2011 6:43 am 
Newbie

Joined: Wed Mar 23, 2011 2:47 am
Posts: 8
Hi guys,

This is krishna, I am working on Hibernate(newly started).

Right Know i am facing one problem . it is I need to connect two databases in hibernate . if it is possible please give me reply.

Problem figure:

in Mysql database i have 4 databases, from java eclipse (using HIbernate) i need to access these 4 data bases.

Please help me.


Thanks Hibernate Forum and users..


Top
 Profile  
 
 Post subject: Re: How to connect two databases to hibernate?
PostPosted: Fri Mar 25, 2011 1:22 pm 
Newbie

Joined: Tue Mar 22, 2011 4:28 pm
Posts: 9
Create separate config files(hib1.cfg.xml hib2.cfg.xml) for connecting to the databases and load the sessionfactory like new Configuration().config(hib1.cfg.xml).buildsessionfactory() and 2nd sessionfactory as new Configuration().config(hib2.cfg.xml).buildsessionfactory() and work with these sessionfactories


Top
 Profile  
 
 Post subject: Re: How to connect two databases to hibernate?
PostPosted: Tue Apr 19, 2011 3:05 am 
Newbie

Joined: Wed Mar 23, 2011 2:47 am
Posts: 8
Thanks yarle123 for your time,

i got it with different config files.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.