This is set at configuration time, so once you have started your application and built the session factory it can't be changed. You can set this programmatically on the configuration. We are doing something like this:
Code:
Configuration cfg = new Conficguration();
cfg.setProperty("hibernate.connection.url", dbUrl);
cfg.setProperty("hibernate.connection.username", username);
cfg.setProperty("hibernate.connection.password", password);
// .. and a lot of other things....
cfg.configure();
SessionFactory sf = cfg.buildSessionFactory();