user1593787
user1593787

Reputation: 1

WSO2 api mgr mysql db

i guess i'm not the only one trying to play with the new WSO2 API mgr. As explained in readme, i try to use mysql to store all data. I uploaded in the correct file the jdbc driver for mysql now the question is to change the setting in master-datasources.xml but the only example provided is in the readme file but only for mssql and i also never used jdbc ... using the mssql example in README what do you think of this setup customized for mysql :

    <datasource>
        <name>WSO2_CARBON_DB</name>
        <description>The datasource used for registry and user manager</description>
        <jndiConfig>
            <name>jdbc/WSO2CarbonDB</name>
        </jndiConfig>
        <definition type="RDBMS">
            <configuration>
                <url>jdbc:jtds:mysql://db.mydomain.com:3306/USERDB</url>
                <username>USER</username>
                <password>USER</password>
                <driverClassName>net.sourceforge.jtds.jdbc.Driver</driverClassName>
                <maxActive>50</maxActive>
                <maxWait>60000</maxWait>
                <testOnBorrow>true</testOnBorrow>
                <validationQuery>SELECT 1</validationQuery>
                <validationInterval>30000</validationInterval>
            </configuration>
        </definition>
    </datasource>

Upvotes: 0

Views: 1436

Answers (2)

AlejandroHernandez.Inc
AlejandroHernandez.Inc

Reputation: 153

I had the same issue and this page helped me: http://shavanthaw.blogspot.mx/2013/02/how-to-connect-wso2-is-server-to.html

Upvotes: 0

Prabath Abeysekara
Prabath Abeysekara

Reputation: 1085

In the posted datasource configuration, I see you are using JTDS driver to connect to MySQL which is wrong. JTDS only support MSSQL and Sybase databases and therefore you have to use the MySQL JDBC driver in order to get the datasource configured properly to connect to a MySQL backend database. To do that, Download the MySQL JDBC driver from [1] and place it inside API_MANAGER_HOME/repository/component/lib folder and change the datasource configuration as shown below.

<datasource>
        <name>WSO2_CARBON_DB</name>
        <description>The datasource used for registry and user manager</description>
        <jndiConfig>
            <name>jdbc/WSO2CarbonDB</name>
        </jndiConfig>
        <definition type="RDBMS">
            <configuration>
                <url>jdbc:mysql://hostname_or_ip:3306/database_name</url>
                <username>valid_mysql_username</username>
                <password>valid_mysql_password</password>
                <driverClassName>com.mysql.jdbc.Driver</driverClassName>
                <maxActive>50</maxActive>
                <maxWait>60000</maxWait>
                <testOnBorrow>true</testOnBorrow>
                <validationQuery>SELECT 1</validationQuery>
                <validationInterval>30000</validationInterval>
            </configuration>
        </definition>

Regards, Prabath

[1] http://dev.mysql.com/downloads/connector/j/

Upvotes: 1

Related Questions