This documentation is for WSO2 Data Services Server 3.5.0. View documentation for the latest release.
RDBMS - Data Services Server 3.5.0 - WSO2 Documentation
||
Skip to end of metadata
Go to start of metadata

This topic describes how you can add RDBMS datasources to your data service. RDBMS datasources are used to service enable data from a relational database. 

Note that the instructions given here explains how to create RDBMS datasources that are specific to the data service. Alternatively, RDBMS datasources can be defined for your server using the instructions given here, which you can add to any data service as a Carbon datasource.

Follow the steps from 1 to 3 in creating a data service using various data sources to get the Add New Data Source screen shown below. Then, select RDBMS as the datasource type, to open the RDBMS-specific options as shown below: 

The options in the above window are described below:

datasource type

There are two types of RDBMS datasources as follows:

  • Default
    For the default type, connection properties such as driver class, URL and credentials must be entered as shown in the example above.

  • External datasource
    If you need to add a datasource supported by an external provider class such as com.mysql.jdbc.jdbc2.optional.MysqlXADataSource, select the external option and enter the name and value of connection properties by clicking Add Property. For example,
    After an external datasource is created, it can be used as a usual datasource in queries.

Database engine

The database management system. In the above example, we take MySQL.

Driver class/URL

Depending on the database engine, copy the relevant JDBC driver to the <PRODUCT_HOME>/repository/components/lib directory. For example, cp mysql-connector-java-5.XX-bin.jar /home/user/wso2ds/wso2-dataservices-XX/repository/components/lib.

If the driver class does not exist in the relevant folders when you create the datasource, you get an exception. For example, 'Cannot load JDBC driver class com.mysql.jdbc.Driver'.

Enable OData

From DSS 3.5.0 onwards, OData protocol version 4 (OASIS standards) is supported, which mainly provides support for CRUD operations. You can easily expose databases as an odata service by selecting this check box. Currently, Odata service feature support is available for RDBMS datasources and Cassandra datasources. If you have enabled Odata for your data service, you can complete the data service creation process. That is, you are not required to define queries or operations for the service. This Odata service will now be accessible from the following endpoints:

You can find a sample demonstration of an OData service here.

Use as secret alias

For information, see Securing Datasource Password.

Datasource configuration parameters

For information, see Datasource Configuration Parameters.

Dynamic user authentication

For information, see Dynamic User Authentication.

To write a query to this datasource, see Step 3: Writing Data Service Queries.

  • No labels