Hi,
you can set a new hibernate.cfg.xml File with this Method in the HibernateSessionFactory.java
/**
* return session factory
*
* session factory will be rebuilded in the next call
*/
public static void setConfigFile(String configFile) {
HibernateSessionFactory.configFile = configFile;
sessionFactory = null;
}
The Parameter is the Path to the Configurationfile
e.g.: "/path/to/hibernate/NEWhibernate.cfg.xml"
After this, you have a new session, when you connect over a DAO Object to the Database.
By
|