Re: Switch db connection when Local Remote

2008-12-03 Thread Ulf Gitschthaler
Maybe you should have a look at: http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html It describes how to use JNDI for your database connection. In short: the tomcat itself holds the necessary connection data and connects via JNDI to the DB. Jeremy Thomerson wrote:

Re: Switch db connection when Local Remote

2008-12-03 Thread Anton Veretennikov
Thanks you for suggestions. On Wed, Dec 3, 2008 at 5:55 PM, Ulf Gitschthaler [EMAIL PROTECTED] wrote: Maybe you should have a look at: http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html It describes how to use JNDI for your database connection. In short: the tomcat

Re: Switch db connection when Local Remote

2008-12-03 Thread James Carman
We use profiles in Maven2 to decide which configuration parameters to build with. Take a look at the example project for Wicketopia for an example of how we do that: https://wicketopia.svn.sourceforge.net/svnroot/wicketopia/trunk/example/ Basically, we add in a special resources directory that's

Re: Switch db connection when Local Remote

2008-12-03 Thread Anton Veretennikov
Thank you, James! On Wed, Dec 3, 2008 at 7:45 PM, James Carman [EMAIL PROTECTED] wrote: We use profiles in Maven2 to decide which configuration parameters to build with. Take a look at the example project for Wicketopia for an example of how we do that:

Re: Switch db connection when Local Remote

2008-12-03 Thread James Carman
If you're using Hibernate, one thing we do with this, to make sure the target database is up to snuff (all the right tables/columns, etc.) is to run a test case that executes the verifier from Hibernate against the schema (our test cases don't usually touch the real database; they run against an

Switch db connection when Local Remote

2008-12-02 Thread Anton Veretennikov
Hello Wicket users, I test my app on local Tomcat and update it frequently on remote. They have different MySQL DB connection params. What is the easiest way to decide which params to choose depending on where Tomcat is running without editing of xml-files? I need to know it during init() of

Re: Switch db connection when Local Remote

2008-12-02 Thread Jeremy Thomerson
There are a myriad of ways, but most are going to include something like: - read them from a properties file - configure them in web.xml or tomcat config It doesn't sound like you're using Spring or similar to configure your database access, but since I do, I typically use a properties file for