0

I have context.xml

<Context>
<Resource name="jdbc/XX" auth="Container" type="javax.sql.DataSource"
           maxActive="50" maxIdle="30" maxWait="10000"
           username="postgres" password="xxxx" 
           driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://localhost:5432/test?createDatabaseIfNotExist=true"/>

</Context>

I want to assign values for username , password and url dynamically. Values should be fetched from config properties file.

username, password are encrypted in Config properties.

How to get values dynamically, decrypt those properties and assign it in context.xml?

  • 1
    possible duplicate of [Encrypting clear text database password in context.xml for Liferay](http://stackoverflow.com/questions/31202697/encrypting-clear-text-database-password-in-context-xml-for-liferay) – Olaf Kock Jul 14 '15 at 05:57
  • I want to know how to decrypt it and get properties values. The link talks about encryption. – Sindhu Shashidhar Jul 14 '15 at 15:59
  • http://stackoverflow.com/questions/129160/how-to-avoid-storing-passwords-in-the-clear-for-tomcats-server-xml-resource-def – Amit Parashar Jul 14 '15 at 17:21
  • Did you read past the question that I declared as duplicate, understand the answer and check the answer that it links to? – Olaf Kock Jul 15 '15 at 05:50
  • Yes Olaf I read that. I want to create data source from config properties. Is there an option to do that? – Sindhu Shashidhar Jul 15 '15 at 20:28

0 Answers0