How to change hibernate settings on runtime
Tuesday, December 16th, 2008One is you can build your configuration from scratch but what I like to do is getting the standard settings from my hibernate.cfg.xml file then change some of the values on my code. here’s how I do it
Configuration conf = new Configuration();
conf.configure().setProperty(“hibernate.connection.url”, “jdbc:mysql://”+host+”/”+dbname);
conf.setProperty(“hibernate.connection.username”, user);
conf.setProperty(“hibernate.connection.password”, password);




