title: Best way of monitoring jndi datasources on Tomcat servers
body: <p>We have a monitoring app (Java Spring app) that performs a bunch of tests for various web services, web apps, databases, etc. and notifies us when things have gone wrong.</p>
  
  <p>The apps we're monitoring are Java web apps (written in Vaadin), and occasionally they will lose their database connection and we don't find out until a user tries to do something that hits the database and it fails.</p>
  
  <p>The apps are running on Tomcat servers, using jndi -- what are some lightweight/easy to implement options for programmatically figuring out whether our Tomcat servers still have good connections to their databases?  </p>
  
  <p>Keep in mind that the monitoring app as well as the other apps are all running on different Tomcat servers on different boxes.</p>
  
  <p>Unfortunately, there are no web services that we can call for these apps, otherwise we would just do that.</p>