-->
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: How to dynamicaly configure Hibenate
PostPosted: Fri Feb 27, 2009 6:12 am 
Beginner
Beginner

Joined: Mon Feb 02, 2009 3:22 am
Posts: 26
Hello all,


I use MyEclipse to develop hibernate application. I found the hibernate.cfg.xml is put in the same folder as java class file, so the user can't update this file after the package is deployed. I'd like the user can access the hibernate.cfg.xml to update database url, username, password so that the application can be dynamically configured. how to solve this problem?

Thanks


Yhqian


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 27, 2009 7:21 am 
Newbie

Joined: Fri Feb 27, 2009 6:55 am
Posts: 1
Location: Switzerland
Hello,

I have the same problem. If you have found a solution, please let me know.

many thanks
Zoran


Top
 Profile  
 
 Post subject: Re: How to dynamicaly configure Hibenate
PostPosted: Fri Feb 27, 2009 9:45 am 
Beginner
Beginner

Joined: Wed Nov 19, 2008 8:25 am
Posts: 46
Location: Saint Petersburg, Russian Federation
yhqian99 wrote:
Hello all,


I use MyEclipse to develop hibernate application. I found the hibernate.cfg.xml is put in the same folder as java class file, so the user can't update this file after the package is deployed. I'd like the user can access the hibernate.cfg.xml to update database url, username, password so that the application can be dynamically configured. how to solve this problem?

Thanks


Yhqian


Just don't include the hibernate.cfg.xml to the jar and let it remain at application classpath.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 27, 2009 10:14 am 
Beginner
Beginner

Joined: Mon Feb 02, 2009 3:22 am
Posts: 26
I found this is quite a simple problem after I read the API of Configuration.

I change to use Configuration. configure(File configFile) so the hibernate.cfg.xml can be placed at any place.


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.