By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,638 Members | 1,456 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,638 IT Pros & Developers. It's quick & easy.

Apache XML configuration modify sample.cfg.xml

P: 1
I need to modify hibernate.cfg.xml with encrypted password by running my own java class.

Expand|Select|Wrap|Line Numbers
  1. <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE hibernate-configuration PUBLIC
  2.           "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
  3.           "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="dialect">
  4.        org.hibernate.dialect.MySQLDialect
  5.      </property> <property name="connection.url">
  6.     jdbc:mysql://localhost:3306/dbname
  7.      </property> <property name="connection.username">user</property> <property name="connection.password">user123</property> <property name="connection.driver_class">
  8.     com.mysql.jdbc.Driver
  9.      </property> <property name="myeclipse.connection.profile">
  10.     driver
  11.      </property> </session-factory> </hibernate-configuration>
when I run my java class the above hibernate.cfg.xml file property "connection.password" needs to be modified with encrypted password. Modified xml file will be like below


Expand|Select|Wrap|Line Numbers
  1. <hibernate-configuration> <session-factory>
  2.     ........
  3.     ........
  4.      <property name="connection.username">user</property> <property name="connection.password">
  5.           abdl#56$!+-xdESQ@_%fE
  6.      </property>
  7.      ........
  8.      ........
  9.  
  10. </session-factory> </hibernate-configuration>
Advance thanks to help me in solving my problem any one..
Oct 10 '12 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.