P
Paul Ackerman
I am trying to write a Java-based web application. I am
using Tomcat 4.1.24 as my servlet/JSP engine. The
application uses MySQL.
My question is this: I want to use two databases, one for
production, one for testing. I have two directories under
the webapps directory, prod and test. I want the
application to know which directory it is in and point to
its respective database. Is there a way to do this using
the directory name? Or should I read it out of a file, like
web.xml?
I have tried to parse my own XML file, but the application
will only read out of the $CATALINA_HOME\bin directory. I
can't seem to get it to read a file from the home directory
of the application.
I haven't tried using JNDI or DataSources yet because it
looks like they use the server.xml file. If I used that I
think I would still have a problem of not being able to
decide which entry to use.
I currently have only one version of Tomcat running. Do I
need to run another Tomcat instance to make this work? If
so, how does the application know which version of Tomcat to
use?
Thank you in advance for your assistance.
- Paul Ackerman
(e-mail address removed)
using Tomcat 4.1.24 as my servlet/JSP engine. The
application uses MySQL.
My question is this: I want to use two databases, one for
production, one for testing. I have two directories under
the webapps directory, prod and test. I want the
application to know which directory it is in and point to
its respective database. Is there a way to do this using
the directory name? Or should I read it out of a file, like
web.xml?
I have tried to parse my own XML file, but the application
will only read out of the $CATALINA_HOME\bin directory. I
can't seem to get it to read a file from the home directory
of the application.
I haven't tried using JNDI or DataSources yet because it
looks like they use the server.xml file. If I used that I
think I would still have a problem of not being able to
decide which entry to use.
I currently have only one version of Tomcat running. Do I
need to run another Tomcat instance to make this work? If
so, how does the application know which version of Tomcat to
use?
Thank you in advance for your assistance.
- Paul Ackerman
(e-mail address removed)