I was wondering if anyone could help out (or if this is even possible). I have a Tomcat 7 server application that should be able to connect to one of several databases (sybase, oracle, mysql), and I have a separate context.xml for each of these. What I am trying to do is have something like this -
.../conf/mysql/localhost/context.xml
.../conf/oracle/localhost/context.xml
.../conf/sybase/localhost/context.xml
and in the server.xml, a way of setting which context.xml it will read in depending on a property set, like this
<Engine defaultHost="localhost" name="${dbType}">
<Host update:appBase="myApplication"/>
<remove:Realm/>
</Engine>
where ${dbType} property is located in a separate config file, so in theory by setting it to "oracle", it should use the context.xml located under ../conf/oracle and so on.
Judging from the tutorial from http://tomcat.apache.org/tomcat-7.0-doc/config/context.html, this should be possible, however I am unable to even create an instance of tomcat.
Any help is much appreciated!