Why would you like to do that?
I have multiple database located at different locations so i need to connect to that database on fly.
You have to use pure JDBC or some kind of helper lib. This won't work with JPA.
actually it is possible. The clue is to use multiple dynamic entityManagers. And surprise surprise the solution can be found in the seam documentation ;) I think this goes into the direction to solve your problem.