• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hibernate.cfg.xml

 
Dhannya Zacharia
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

Is it possible to place hibernate.cfg.xml inside WebContent rather than in the src folder.

I wanted to move all the configuration details to one folder in WebContent. Thats why i asked if its possible to move hibernate.cfg.xml.


Thanks
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can put hibernate.cfg.xml wherever you like. Look at the javadocs for Configuration, there are methods to configure based on a File or a URL. If you load the file yourself, rather than letting Hibernate find it, then you can tell it where the file is.
 
Tamas Jano
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure you secure it. Place it behind WEB-INF.
You don't want all your connection details to be revealed, do you?

As a note, if in the src, the config file gets copied by default to the output directory (if settings left on default in most IDEs) and that's one of the /bin or WEB-INF/classes paths.
 
Dhannya Zacharia
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
My hibernate.cfg.xml is there inside my applications classes folder...

Apart from that i want to put it in another folder... Do i have to use an ANT Script for this... I am not getting it right
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do i have to use an ANT Script for this...

If you like. Or you can just do it manually.

I am not getting it right

What, exactly, is going wrong?
[ September 06, 2007: Message edited by: Paul Sturrock ]
 
Dhannya Zacharia
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,

I was confused. but now i am on the right track... Thanks for the help...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic