0 Replies Latest reply on Feb 17, 2005 9:13 AM by Colin Berrouard

    How I can connect to another database

    Colin Berrouard Newbie

      Hi,
      I want to create to connection (connection A and connection B). I have created the first connection, and it's work. But when I create the second, I have created the datasource, and after I do what...

      ---------------------------
      Connection A:
      BD: UNI0
      Host: ServerUNI0

      I modified those files:

      File: standardjaws.xml
      java:/MCDCoreDS
      <type-mapping>Oracle8</type-mapping>
      false

      File: standardjbosscmp-jdbc.xml

      java:/MCDCoreDS
      <datasource-mapping>Oracle9i</datasource-mapping>

      File: login-config.xml
      <application-policy name = "OracleDbRealm">

      <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"
      flag = "required">
      <module-option name = "principal">sa</module-option>
      <module-option name = "userName">sa</module-option>
      <module-option name = "password"></module-option>
      <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=MCDCoreDS</module-option>
      </login-module>

      </application-policy>

      I create this file.

      File: MCDCore-ds.xml


      <local-tx-datasource>

      <jndi-name>MCDCoreDS</jndi-name>
      <!-- <use-java-context>false</use-java-context> -->
      <connection-url>jdbc:oracle:thin:@ServerUNI0:1521:UNI0</connection-url>
      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name>myuser</user-name>
      mypassword1
      <min-pool-size>5</min-pool-size>
      <max-pool-size>5</max-pool-size>
      <idle-timeout-minutes>0</idle-timeout-minutes>
      <valid-connection-sql>select 1 from sys.dual</valid-connection-sql>
      <exception-sorter-class>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class>

      </local-tx-datasource>



      -----------------------------
      Connection B:
      BD: FIN0
      Host: ServerFIN0

      I have created a datasource file.
      After, what do I have to do ? create others file standardjaws.xml and standardjbosscmp-jdbc.xml ...


      File: OPRCore-ds.xml


      <local-tx-datasource>

      <jndi-name>OPRCoreDS</jndi-name>
      <!-- <use-java-context>false</use-java-context> -->
      <connection-url>jdbc:oracle:thin:@ServerFIN0:1521:FIN0</connection-url>
      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name>myuser</user-name>
      mypassword1
      <min-pool-size>5</min-pool-size>
      <max-pool-size>5</max-pool-size>
      <idle-timeout-minutes>0</idle-timeout-minutes>
      <valid-connection-sql>select 1 from sys.dual</valid-connection-sql>
      <exception-sorter-class>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class>

      </local-tx-datasource>