finsalscollons
Programmer
Hi.
I am using a JDBC Connection pool in Tomcat 5. I have defined it in conf\Catalina\localhost\ROOT.xml (instead of server.xml as Tomcat 4). So far, everything is ok.
The problem is the database password appears at this file as unencrypted. That is, something like this:
<parameter>
<name>password</name>
<value>MY_UNENCRYPTED_PASSWORD</value>
</parameter>
I am teaching a Tomcat course and my students tell me that this is not very safe, since the password is in plain text and everybody could see it easily. I tell them that they can set the permissions of that file to the webmaster, but they are not convinced (and honestly me neither, I would prefer the password to be encrypted in some form).
Is there a way to do this? I have been searching on the Web and I found nothing.
Thanks in advance,
Vicent Palasí
Comment: I attach the whole file
<Context path="" docBase=“ROOT">
<Resource name="jdbc/prueba" scope="Shareable" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/prueba">
<parameter>
<name>factory</name> <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<!-- DBCP database connection settings -->
<parameter>
<name>url</name>
<value>jdbc:mysql://localhost/prueba</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>com.mysql.jdbc.Driver</value>
</parameter>
<parameter>
<name>username</name>
<value>root</value>
</parameter>
<parameter>
<name>password</name>
<value>arrel</value>
</parameter>
<!-- DBCP connection pooling options -->
<parameter>
<name>maxWait</name>
<value>3000</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>100</value>
</parameter>
I am using a JDBC Connection pool in Tomcat 5. I have defined it in conf\Catalina\localhost\ROOT.xml (instead of server.xml as Tomcat 4). So far, everything is ok.
The problem is the database password appears at this file as unencrypted. That is, something like this:
<parameter>
<name>password</name>
<value>MY_UNENCRYPTED_PASSWORD</value>
</parameter>
I am teaching a Tomcat course and my students tell me that this is not very safe, since the password is in plain text and everybody could see it easily. I tell them that they can set the permissions of that file to the webmaster, but they are not convinced (and honestly me neither, I would prefer the password to be encrypted in some form).
Is there a way to do this? I have been searching on the Web and I found nothing.
Thanks in advance,
Vicent Palasí
Comment: I attach the whole file
<Context path="" docBase=“ROOT">
<Resource name="jdbc/prueba" scope="Shareable" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/prueba">
<parameter>
<name>factory</name> <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<!-- DBCP database connection settings -->
<parameter>
<name>url</name>
<value>jdbc:mysql://localhost/prueba</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>com.mysql.jdbc.Driver</value>
</parameter>
<parameter>
<name>username</name>
<value>root</value>
</parameter>
<parameter>
<name>password</name>
<value>arrel</value>
</parameter>
<!-- DBCP connection pooling options -->
<parameter>
<name>maxWait</name>
<value>3000</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>100</value>
</parameter>