Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Open the <PRODUCT_HOME>/repository/conf/datasources/master-datasources.xml file and locate the <datasource> configuration element.

  2. You simply have to update the url pointing to your MySQL database, the username and password required to access the database and the MySQL driver details as shown below. Further, be sure to set the disable auto committing by setting the <defaultAutoCommit> element to false for the MB database. This means that each SQL statement will be committed to the database as individual transactions, as opposed to committing multiple SQL statements as one transaction. 

    Optionally, you can update the other elements for your database connection.

    Localtabgroup
    Localtab
    titleMySQL
    Code Block
    languagehtml/xml
    <datasource>
           <name>WSO2_MB_STORE_DB</name>
           <description></description>
           <jndiConfig>
               <name>jdbc/WSO2MBStoreDB</name>
           </jndiConfig>
           <definition type="RDBMS">
               <configuration>
                   <url>jdbc:mysql://localhost:3306/wso2_mb</url>
                   <username>wso2carbon</username>
                   <password>wso2carbon</password>
                   <driverClassName>com.mysql.jdbc.Driver</driverClassName>
                   <maxActive>80</maxActive>
                   <maxWait>60000</maxWait>
                   <minIdle>5</minIdle>
                   <testOnBorrow>true</testOnBorrow>
                   <validationQuery>SELECT 1</validationQuery>
                   <validationInterval>30000</validationInterval>
    			   <defaultAutoCommit>false</defaultAutoCommit>
               </configuration>
           </definition>
    </datasource>
    Localtab
    titleMS SQL
    Code Block
    languagexml
    <datasource>
       <name>WSO2_MB_STORE_DB</name>
       <description></description>
       <jndiConfig>
           <name>WSO2MBStoreDB</name>
       </jndiConfig>
       <definition type="RDBMS">
             <configuration>
                        <url>jdbc:jtds:sqlserver://localhost:1433/wso2_mb</url>
                        <username>sa</username>
                        <password>sa</password>
                        <driverClassName>com.microsoft.sqlserver.jdbc.SQLServerDriver</driverClassName>
                        <maxActive>200</maxActive>
                        <maxWait>60000</maxWait>
                        <minIdle>5</minIdle>
                        <testOnBorrow>true</testOnBorrow>
                        <validationQuery>SELECT 1</validationQuery>
                        <validationInterval>30000</validationInterval>
                        <defaultAutoCommit>false</defaultAutoCommit>
             </configuration>
         </definition>
    </datasource>         
    Localtab
    titleOracle
    Code Block
    languagexml
    <datasource>
         <name>WSO2_MB_STORE_DB</name>
    	 <description></description>
         <jndiConfig>
             <name>WSO2MBStoreDB</name>
         </jndiConfig>
         <definition type="RDBMS">
             <configuration>
                <driverClassName>oracle.jdbc.driver.OracleDriver</driverClassName>
                <url>jdbc:oracle:thin:@localhost:1521/orcl</url>
                <maxActive>100</maxActive>
                <maxWait>60000</maxWait>
                <minIdle>5</minIdle>
                <testOnBorrow>true</testOnBorrow>
                <validationQuery>SELECT 1 FROM DUAL</validationQuery>
                <validationInterval>30000</validationInterval>
                <username>scott</username>
                <password>tiger</password>
                <defaultAutoCommit>false</defaultAutoCommit>
             </configuration>
         </definition>
    </datasource>

...