Hibernate Question

I

Ian Semmel

I don't know if this is the correct ng for this but ..

How do you programatically set the password for a hibernate connection ?

I have tried something like

configuration = new Configuration ();
configuration.configure ( configFile );
Properties p = configuration.getProperties ();
p.setProperty ( "connection.username", "user" );
p.setProperty ( "connection.password", "password" );
configuration.setProperties ( p );
sessionFactory = configuration.buildSessionFactory ();

This seems to have no effect and it uses the password in the config file.

If I delete the user and password fields from the config file the connection cannot be made.
 
I

Ian Semmel

GG said:
Ian Semmel pisze:

mayby: hibernate.connection.pasword

yes, that's it.
In the xml file it is "connection.password" but in the properties, you use "hibernate.connection.password".

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Remote SSH and Configuring code help 0
Hibernate cannot find hibernate.cfg.xml 1
Problem with Hibernate. 0
hibernate question 4
Hibernate errors 0
Hibernate: not mapped error 3
Hibernate 1
Hibernate Hell 5

Members online

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top