How to change database connection without compiling, using JBoss Seam?

Posted by MLB on Stack Overflow See other posts from Stack Overflow or by MLB
Published on 2010-03-25T13:30:47Z Indexed on 2010/03/25 13:33 UTC
Read the original article Hit count: 190

Filed under:

Hi there:

I am developing a web site in Eclipse using JBoss Seam 1.2. My site uses a database (named ALregcli) hosted in a MySQL server. That database has only one table named trazasfallos. The server I am using is local (localhost).

When I deploy the site in an "X HOST", the MySQL server it is not in the same computer... the server is in an "Y HOST", so, the connection will not be stablished to the database. I was changing the Context.xml, but it didn't work. The only way it worked was changing the host to connect to in the Context.xml and "recompiling" all the project. Then, it generates the new version of the compiled class trazasfallos.class, and this is the file I have to overwrite for connecting to a new database server.

The point is that I want to make the change without "recompiling" anything... Maybe there is a way to make only a "text change" and it will work (maybe in a .xml file)... but I don't know how to do it!!

The question is: how to change the connection to the database without recompiling anything in the site??

I am sorry about my English, I am from Cuba.

© Stack Overflow or respective owner

Related posts about java