These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: setProperty after configure
PostPosted: Fri Sep 26, 2008 12:38 pm 
Newbie

Joined: Fri Sep 26, 2008 10:27 am
Posts: 2
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?


Top
 Profile  
 
 Post subject: Same problem
PostPosted: Sat Oct 04, 2008 11:33 am 
Newbie

Joined: Sun Jul 27, 2008 10:56 am
Posts: 17
Hi mrp,

scuse me but I'm not answering your question, but I'm asking for the same problem too, and so please Hibernate guru help us!!!!


Best regards
Gamby


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.