1
I am using JPA in my application and so I have a file persistence.xml
which contains the connection data to 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 wouldn’t like to commit passwords and users in plain text, so I would like to know if anyone knows any ELEGANT alternative to manage the sensitive data of my application, some encryption mechanism, for example.
If you are going to use the solution together with a versioning system, I recommend a look at this project, which happens to be from Stackexchange: https://github.com/StackExchange/blackbox
– Bacco
If you use a full Javaee Enterprise container configuration and management is in charge of the container, Tomcat is also used JNDI to name these resources
– Dilnei Cunha
I think JNDI in this case would be ideal for me. I prefer to leave the container (Tomcat) this control of sensitive data. Thanks for the tips! :)
– Giuliana Bezerra