On 08.09.11 14:38, mrab wrote: > So now I would like to do it the proper way, whatever that is! I > looked at configuration-howto.html which allows configuring the > TurbineResources.properties file. However, the database url is now in > torque.properties. Is there some way to use this method anyway? Or what is > the best way to accomplish this?
(This is actually a Torque question, the correct mailing list would be [email protected]) My suggestion would be to use a JNDI pool. See http://tomcat.apache.org/tomcat-7.0-doc/jndi-resources-howto.html#JDBC_Data_Sources on how to configure this in Tomcat. I suggest to put the configuration into server.xml-><GlobalNamingResources> and use a ResourceLink-Element in your context file to map the global data source to your local name. See http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Resource%20Links on how that works. If you have that running, see the description of the JndiDataSourceFactory at http://db.apache.org/torque/releases/torque-3.3/runtime/reference/initialisation-configuration.html on how to configure Torque. You would have the option to use the ResourceLink element in your context file to map your data source name (jdbc/DB) to the global ones (jdbc/DBQA, jdbc/DBTEST). That would require redeployment of your application on a change. The other way would be to set a system property into the server.xml Resource definition like ${database.url} and start Tomcat with -D database.url=jdbc:whatever. See http://java-monitor.com/forum/showthread.php?t=838 for an example. HTH. Bye, Thomas. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
