-
1. Re: Logging in to different databases ?
jonlee Dec 1, 2003 8:37 PM (in response to neptune5)You can have as many datasources as you wish to define. However, in general you infrastructure, if it is defined to use one datasource, will use the one your application references.
For example if the JNDI name your J2EE application references is java:/MyAppDS and that in turn points to the JDBC URL jdbc:postgresql://dbserver:5432/development then it would be accessing the "development" database.
If you wanted to switch your application to use the testing database, you might change the JDBC URL jdbc:postgresql://dbserver:5432/testing.
A J2EE application can reference multiple datasources but they must have different JNDI names.
You probably need to supplement this explanation with some reading on JNDI, J2EE components and resource mapping. -
2. Re: Logging in to different databases ?
neptune5 Dec 5, 2003 4:19 PM (in response to neptune5)Thanks for that very helpful , at least I'm now looking in the right area . JNDI is the key to all this .
Regards Adrian