• Post Reply Bookmark Topic Watch Topic
  • New Topic

user id and password in hibernate config

 
sudharshan tettu
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am learning hibernate. I want to know how can we check user id and password at run time [upon user login credentials]

rather than hardcoding in hibernate.cfg.xml
<session-factory>
<property name="connection.username">test</property>
<property name="connection.password">password123</property>
 
M K Rayapudi
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sudarsan tettu wrote:Hi
I am learning hibernate. I want to know how can we check user id and password at run time [upon user login credentials]

rather than hardcoding in hibernate.cfg.xml
<session-factory>
<property name="connection.username">test</property>
<property name="connection.password">password123</property>

hardcoding?
IMO, hibernate.cfg.xml is a configuration file, providing credentials in a configuration file is not hard coding.
If you provide credentials in .Java file it is called hard coding.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!