1 Reply Latest reply on Sep 10, 2003 2:17 AM by juha

    Syntax for multiple datasources using JBoss 3.2.1

    tommartell

      I want to run two applications on our JBoss server - Rubis and Petstore. Rubis is configured to work with mySQL, Petstore with Cloudscape. I have both working independently on their own modified versions of jboss by setting the datasource informatoin in /server/default/conf/ (standardjaws.xml and standardjbosscmp-jdbc.xml).

      How do you define both datasources to operate simultaneously, allowing both DBs to be used?

      I tried adding a second datasource tag into the relevant files in teh following manner:

      java:/CatalogDB
      <type-mapping>Cloudscape</type-mapping>
      false

      java:/Rubis
      <type-mapping>mySQL</type-mapping>
      false

      However it then complains about having multiple datasource tags.

      What is the proper syntax for this?

      Thanks for the help.

      -Tom

        • 1. Re: Syntax for multiple datasources using JBoss 3.2.1

          Standardjbosscmp-jdbc.xml contains the *default* datasource that your beans connect to if you don't specifically tell them which datasource to use.

          In order to use two different datasources you need to deploy your applications with jbosscmp-jdbc.xml deployment descriptors where you define the specific datasource you want that CMP bean to connect to (rather than using the default datasource it finds from standardjbosscmp-jdbc.xml file).

          -- Juha