In Tomcat, nothing is done to do what you want. If you move the settings to the tomcat JTDI tree, you will need to put the user / name password combination in the server.xml or context.xml file. Here are some possible solutions to your problem.
Option 1: Use a Tomcat Listener
tomcat server.xml, , java-, tomcat. Tomcat-, , / Comobo , . tomcat tomcat, tomcat. tomcat CATALINA_HOME\lib.
/ , , , tomcat. , tomcat, , , , , .
JNDI tomcat , context.xml, ResourceLink, jndi . , , JNDI .
Spring , tomcat, Spring, tomcat. , / , .
2:
, , . . , .
3. JMX
JMX MBean, JVM MBeanServer, , username/password. MBean tomcat, perl script MBean /.
, .