Access to Tomcat's JNDI source (connection pool) outside of Tomcat


I was wondering if there was a way to access the connection pool of Tomcat from a Java program (standalone) outside the context of Tomcat.  I am using JasperReports and want to test without have to restart Tomcat everytime.  The tool lets you run the JavaBean so I can see if the results are correct.

James CochraneB2B FINTECH WRITER/Technology WriterAsked:
Who is Participating?
objectsConnect With a Mentor Commented:
You can install and run DBCP without Tomcat
I don't think that is possible (even if you managed to get access to the jndi remotely).
<ResourceParams name="jdbc/TestDB">

If you look at tomcat source:
you will see that this returns
which is not either serializable nor a remote object.
In addition to that I don't think you can even get access to the JNDI remotely.
"The InitialContext is configured as a web application is initially deployed, and is made available to web application components.."
The jndi does not seem to expose any remote access to it.
But as I said before even if you had access you still can't get the DataSource (unless you will replace the datasource factory).
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.