Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • 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: 160
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic