turbine-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Vandahl ...@apache.org>
Subject Re: Turbine 2.3.3 - change database url based on environment (QA, TEST, etc.)
Date Thu, 08 Sep 2011 19:44:44 GMT
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

My suggestion would be to use a JNDI pool. See


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

on how that works.

If you have that running, see the description of the
JndiDataSourceFactory at


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


for an example.


Bye, Thomas.

To unsubscribe, e-mail: user-unsubscribe@turbine.apache.org
For additional commands, e-mail: user-help@turbine.apache.org

View raw message