Sensitive data in persistence.xml

1

I'm using JPA in my application and so I have a persistence.xml file that contains the connection data with my database:

<property name="javax.persistence.jdbc.url" value="jdbc:postgresql://localhost/banco" />
<property name="javax.persistence.jdbc.user" value="admin" />
<property name="javax.persistence.jdbc.password" value="123456" />
<property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver" />
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQL9Dialect" />

I would not like to commmit passwords and plain text users, so I would like to know if anyone knows any SMART alternatives to manage sensitive data in my application, some encryption mechanism, for example.

    
asked by anonymous 28.08.2016 / 18:05

1 answer

1

Solved using JNDI. I prefer to leave the control of the sensitive data to the container (tomcat).

    
28.08.2016 / 23:30