Register / Login
this forum made possible by our volunteer staff, including ...
Roel De Nijs
Stephan van Hulst
Object Relational Mapping
Create hibernate session dynamically
posted 8 years ago
I have a spring-hibernate GUI application where I show a login screen for user to enter his user-name & password. I have to use this credentials to connect to my database.
My database related details are present in hibernate.cfg.xml. My applicationContext.xml has the following entry
<bean id="sessionFactory" lazy-init = "true"
The sessionFactory is autowired to all my DAOs. How can I pass my username & password dynamically to my session factory from my code?
It is sorta covered in the
JavaRanch Style Guide
Boost this thread!
How to use Hibernate along with GWT instantiation on eclipse 3.2
Connecting to two schemas using hibernate
Accessing hibernate.cfg.xml from web project through JAR file
LocalSessionFactoryBean is not a sessionfactory instance
Hibernate with Spring