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

Posted on 2005-04-21
Last Modified: 2013-11-24

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.

Question by:techhound
    LVL 15

    Expert Comment

    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.
    LVL 15

    Expert Comment

    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).
    LVL 92

    Accepted Solution

    You can install and run DBCP without Tomcat

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
    Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
    Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now