Hello,
i have got configurations set in "hibernate.cfg.xml" and load them with conf.configure(), this works fine if i have everything in there.
Now i would like to set some properties dynamicly later, not in the xml (of course before the conf.buildSessionFactory()) I do:
Code:
// mapping and properties from hibernate.cfg.xml
conf.configure();
// db connection properties
Properties prop = new Properties();
prop.setProperty("connection.url", "jdbc:mysql://*meinserver*");
prop.setProperty("connection.username", "*meinuser*");
prop.setProperty("connection.password", "*meinpass*");
conf.mergeProperties(prop);
conf.buildSessionFactory()
and get:
17:58:52,187 WARN UserSuppliedConnectionProvider:23 - No connection properties specified - the user must supply JDBC connections
and an Exception later on
If i print the data of the property object:
System.out.println(conf.getProperties().toString());
all properties from hibernate.cfg.xml and my added ones are inside!
what's wrong?