2 Replies Latest reply on Mar 15, 2005 8:36 PM by George Berish

    Why Can't I Use Two MySQL Databases?

    George Berish Novice

      Hi;

      I configured JbBoss to use MySql and created two databases therein:
      "jbossdb"
      "go"

      I'd really like to have JBoss use "jbossdb" for its jms_message, jms_roles, jms_subscriptions, jms_transactions and jms_users tables.

      And I'd like JBoss to use "go" for my bean persistance tables: games, members, plays, names.

      Here is what I tried, but my bean tables still end up in jbossdb.

      Can anyone point me to my problem?

      mysql-ds.xml

      <datasources>
       <local-tx-datasource>
       <jndi-name>DefaultDS</jndi-name>
       <connection-url>jdbc:mysql://localhost:3306/jbossdb</connection-url>
       <driver-class>com.mysql.jdbc.Driver</driver-class>
       ...
       </local-tx-datasource>
       <local-tx-datasource>
       <jndi-name>GoDS</jndi-name>
       <connection-url>jdbc:mysql://localhost:3306/go</connection-url>
       <driver-class>com.mysql.jdbc.Driver</driver-class>
       ...
       </local-tx-datasource>
      </datasources>
      ejb-jar.xml
      <ejb-jar>
       ...
       <enterprise-beans>
       <!-- MemberBean -->
       <entity>
       ...
       <ejb-name>MemberEJB</ejb-name>
       <resource-ref>
       <description/>
       <res-ref-name>GoDS</res-ref-name>
       <res-type>javax.sql.DataSource</res-type>
       ...
       </resource-ref>
       </entity>
       </enterprise-beans>
      </ejb-jar>
      jboss.xml
      <jboss>
       <enterprise-beans>
       <!-- MemberBean -->
       <entity>
       <ejb-name>MemberEJB</ejb-name>
       <local-jndi-name>ejb/MemberLocalHome</local-jndi-name>
       <resource-ref>
       <res-ref-name>GoDS</res-ref-name>
       <jndi-name>java:/GoDS</jndi-name>
       </resource-ref>
       </entity>
       ...
       </enterprise-beans>
       </jboss>
      standardjbosscmp-jdbc.xml
      <jbosscmp-jdbc>
       <defaults>
       <datasource>java:/DefaultDS</datasource>
       <datasource-mapping>mySQL</datasource-mapping>
       ...
       </defaults>
       <type-mappings>
       <type-mapping>
       <name>mySQL</name>
       ...
       </type-mapping>
       </type-mappings>
       ...
      </jbosscmp-jdbc>
      Thanx, glb