This documentation is for WSO2 Data Services Server 3.2.2. View documentation for the latest release.
Carbon Datasources - Data Services Server 3.2.2 - WSO2 Documentation
Skip to end of metadata
Go to start of metadata

A Carbon datasource is a RDBMS or a custom datasource created using the Datasources sub menu of the Configuration menu in the management console. You can simply use that as the datasource of a data service. A Carbon datasource is persisted, and can be used whenever required. To create a Carbon datasource, see Managing Datasources.

Be sure to copy the JDBC driver relevant to the database engine to one of the locations given below.

  • If the driver is a JAR file, add it to the <PRODUCT_HOME>/repository/components/lib directory, so that it will be converted to an OSGI bundle and copied to the dropins directory during server startup. For example, if you are using MySQL, you would specify com.mysql.jdbc.Driver as the driver and would copy mysql-connector-java-5.XX-bin.jar to this directory.
  • If the driver is already an OSGI bundle, you can directly add it to the <PRODUCT_HOME>/repository/components/dropins directory. 

If you do not copy the driver to the relevant directory, you will get an exception similar to "Cannot load JDBC driver class com.mysql.jdbc.Driver" when you create the datasource.

Next, simply use that data source at the time a data service is created. That is, you must first follow the steps from 1 to 3 in creating a data service using various data sources. When you get to the Add New Data Source screen, select Carbon Data Source as the data source type. You get a drop-down list from which an existing Carbon data source can be selected as shown below. 

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

  • No labels