Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

user id and password in hibernate config  RSS feed

 
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: 163
  • 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
Boost this thread!