TomEE datasource password encryption

Execute the following command to get the cipher:

cd <<tomcat_home>>/bin
tomee.sh cipher <<orginal password>>

e.g.

tomee.sh cipher Passw0rd

This will give the cipher something like below

xMH5uM1V9vQzVUv5LG7YLA==

Use this cipher in the resources.xml with the prefix ‘cipher:Static3DES:’ as given below

<resources>
    <Resource id="jdbc/myDS" type="javax.sql.DataSource">

        password = cipher:Static3DES:xMH5uM1V9vQzVUv5LG7YLA==

    </Resource>
</resources>

alternatively you can give as below

<resources>
    <Resource id="jdbc/myDS" type="javax.sql.DataSource">

        password       = xMH5uM1V9vQzVUv5LG7YLA==
        PasswordCipher = Static3DES

    </Resource>
</resources>