I have multiple projects, each having their own hibernate properties file under their classpath. All these business projects use a common project to create a SessionFactory. Everything works fine, when all the hibernate.properties file, refer to the same database.
When I have my first project hibernate properties file, pointing to database A and remaining hibernate properties file pointing to Database B and run the application, all projects are trying to connect to database A. How do I make projects to look for its own hibernate.properties file.
When I asked this question before, I was asked to use hibernate.cfg.xml file. This file will also, go under the classpath, how is it different from hibernate.properties file(Considering my problem).
Remember, that all my projects go to a common project, to get the SessionFactory.
I would like to fix with hibernate.properties file. Since, all my projects are in place, a fix with hibernate.properties file is appreciated.
Thanks.
|