2 Replies Latest reply on Dec 5, 2003 4:19 PM by neptune5

    Logging in to different databases ?

    neptune5 Newbie

      Having worked on ERP systems for the last few years it is possible on as400s to login to different versions of the same database..

      ie Have a test db, a pilot db and live. Is this possible with jboss as it looks to me that the xml file for the datasource takes only one db.

      So could I log into different databases of the same kind ?

      Regards Adrian

        • 1. Re: Logging in to different databases ?
          Jon Barnett Master

          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 Newbie

            Thanks for that very helpful , at least I'm now looking in the right area . JNDI is the key to all this .

            Regards Adrian