-->
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.  [ 4 posts ] 
Author Message
 Post subject: Switching DB
PostPosted: Mon Mar 24, 2008 3:00 am 
Newbie

Joined: Mon Mar 24, 2008 2:55 am
Posts: 5
kindly let me know as how to switch between two databases. i have just a single hibenate.cfg.xml file and have set connection.url for jus one db.

thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 24, 2008 7:03 am 
Beginner
Beginner

Joined: Wed Mar 21, 2007 10:23 am
Posts: 20
Hi sambhavi,

I don't know if it is your case, but using hibernate with spring you have the possibility to define several datasources and assign them to specific DAOs.


Top
 Profile  
 
 Post subject: Switching DB
PostPosted: Mon Mar 24, 2008 8:53 am 
Newbie

Joined: Mon Mar 24, 2008 2:55 am
Posts: 5
Can anyone give me idea to switch databases without using the spring framework.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 24, 2008 9:41 am 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
You have to change the data in your configuration object, rebuild it, and rebuild your session factory.

Check the hibernate api docs. There are some methods for you to read in a new configuration, or set specific properties.

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.