Hi, My project uses Hibernate to lookup datasource. The datasource name is in the hibernate.cfg.xml file.
The rule of my web app is that the datasource info will be written in to the server.xml file after Tomcat 5.5 already startup. I follow the rule but when I start up Tomcat 5.5, it has an error because Hibernate Configuration needs a datasource name when Tomcat startup.
My questiion is: Are there any ways to use Hibernate with a Datasource info added to the server.xml file when Tomcat 5.5 already startup. Do you have any solution for this.
You can always create your SessionFactory through Code. Basically everything that could be in a hibernate.cfg.xml for a SessionFactory has an equivalent Java object, so that you can build up your SessionFactory from code.