-->
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.  [ 2 posts ] 
Author Message
 Post subject: JDBC: Multiple Hibernate properties
PostPosted: Thu Dec 04, 2003 12:24 am 
Newbie

Joined: Fri Oct 17, 2003 12:40 pm
Posts: 16
I use hibernate.properties file to connect to the database. Everything works fine. I have two projects, and each project, talks to different database and each has it own hibernate.properties file.
The two projects work fine individually. But, my project 2 should reference project1. This is where I am having problem. Project 1 connects to database1 and works fine. But when I run my Project2, instead of connecting to database2 (as defined in its hibernate.properties file), it connects to database1. Project2 is also reading the hibernate.properties from project1. How, can I make project2 to read from its hibernate. properties file, or rather, how can I stop project2 from getting the hibernate. properties from project1.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 04, 2003 9:40 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Use hibernate.cfg.xml instead of hibernate.properties and explicit it during session building
(new Configuration()).configure("/project2.cfg.xml");

_________________
Emmanuel


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