Configure dynamically context.xml in woodstock, please help

View: New views
2 Messages — Rating Filter:   Alert me  

Configure dynamically context.xml in woodstock, please help

by ouribeb930 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,



Thanks in advance!!!



I got a big problem, you see...



In the company where I work for, we have 2 virtual servers, one for developers and one for production.



My problem is that I have to compile my project for each environment, including my own...



This is because the context.xml have the connection string for my application to work, but each environment have their own database with their own connection strings...



How can I do the user and password dinamically (or the string complete)?



What I want is to deploy the application without worry about the connection string...



Please, any idea??? [Idea]



Thanks again...





Re: Configure dynamically context.xml in woodstock, please help

by John Yeary :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Please use a JNDI lookup for a database connection. If you have the connection pools pointed at different databases in production and development, this is a really simple and elegant way of doing it. The application simply looks for the same JNDI name, and does not care about which pool it is pointed at.

On Fri, Jun 12, 2009 at 6:10 AM, ouribeb930 <ouribeb930@...> wrote:
Hi,



Thanks in advance!!!



I got a big problem, you see...



In the company where I work for, we have 2 virtual servers, one for developers and one for production.



My problem is that I have to compile my project for each environment, including my own...



This is because the context.xml have the connection string for my application to work, but each environment have their own database with their own connection strings...



How can I do the user and password dinamically (or the string complete)?



What I want is to deploy the application without worry about the connection string...



Please, any idea??? [Idea]



Thanks again...







--
John Yeary
--
http://javaevangelist.blogspot.com

"Far better it is to dare mighty things, to win glorious triumphs, even though checkered by failure, than to take rank with those poor spirits who neither enjoy much nor suffer much, because they live in the grey twilight that knows not victory nor defeat."
-- Theodore Roosevelt