Apache XML configuration modify sample.cfg.xml

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ram R
    New Member
    • Oct 2012
    • 1

    Apache XML configuration modify sample.cfg.xml

    I need to modify hibernate.cfg.x ml with encrypted password by running my own java class.

    Code:
    <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE hibernate-configuration PUBLIC
              "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
              "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="dialect">
           org.hibernate.dialect.MySQLDialect
         </property> <property name="connection.url">
    	jdbc:mysql://localhost:3306/dbname
         </property> <property name="connection.username">user</property> <property name="connection.password">user123</property> <property name="connection.driver_class">
    	com.mysql.jdbc.Driver
         </property> <property name="myeclipse.connection.profile">
    	driver
         </property> </session-factory> </hibernate-configuration>
    when I run my java class the above hibernate.cfg.x ml file property "connection.pas sword" needs to be modified with encrypted password. Modified xml file will be like below


    Code:
    <hibernate-configuration> <session-factory>
        ........
        ........
         <property name="connection.username">user</property> <property name="connection.password">
              abdl#56$!+-xdESQ@_%fE
         </property>
         ........
         ........
        
    </session-factory> </hibernate-configuration>
    Advance thanks to help me in solving my problem any one..
    Last edited by Rabbit; Oct 10 '12, 10:22 PM. Reason: Please use code tags when posting code.
Working...