This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Dynamic connection using Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Dynamic connection using Hibernate" Watch "Dynamic connection using Hibernate" New topic
Author

Dynamic connection using Hibernate

Levi Mendes
Greenhorn

Joined: Oct 11, 2011
Posts: 4
Hello everybody,

Can anyone post some example showing dinamically how to connect the SQLServer with a java app using Hibernate?

Today, I'm using the simple hibernate.cfg.xml, in it I put the connection credentials hardcoded. Now the app need to connect the database according to the user credentials,
In other words I can't put the credentials fixed in this file.
How can I achieve it?


Thank so much.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamic connection using Hibernate
 
Similar Threads
How to secure the database credentials
How to connect to database without password using connection pooling
How to change user credentials when accessing DB
Tomcat Security
Hibernate and connection pooling