Versions Compared

Key

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

A datasource provides information that a server can use to connect to a database or to an external data store.  Datasource management is provided by the following feature in the WSO2 feature repository:

Name : WSO2 Carbon - datasource management feature 
Identifier: org.wso2.carbon.datasource.feature.group

If datasource management capability For example, all WSO2 products are shipped with the wso2carbon.h2 database, and the datasource that is used to connect to this database is defined in the master-datasources.xml files stored in the <PRODUCT_HOME>/repository/conf/datasources/ directory. You can also create your own custom datasources by creating a configuration file and storing it in the same <PRODUCT_HOME>/repository/conf/datasources/ folder. For example, see the custom-datasources.xml file stored in this folder. 

If the datasource management feature is included your product, you can also manage datasources using the management console. If this feature is not included in your product by default, add it by installing the above feature, you can install the following using the instructions given under given under the Feature Management section  section of this documentation:

Name : WSO2 Carbon - datasource management feature 
Identifier: org.wso2.carbon.datasource.feature.group

With this feature, you can define any RDBMS datasource, which can be used to connect to a database/external data store, or you can define your own custom datasources. New datasources can be added to your product using the management console, which can be later edited and deleted for your product instance if required. Note that all datasources created using the management console are saved to the registry of your product. 

See the steps for creating and modifying datasource information:

Table of Contents

...

maxLevel3
minLevel3

Creating datasources using the management console

Use the following steps to add a datasource:

...

Note

When adding an RDBMS datasource, be sure to copy the JDBC driver JAR file for your database to <PRODUCT_HOME>/repository/components/lib.

Modifying datasources

...

After adding datasources, they will appear on the Data Sources page. You can edit and delete them as needed by clicking Edit or Delete.

...

datasources are created (either using the management console or by creating a separate configuration file), you can access them by clicking Data Sources on the Configure tab of the management console. You can also edit and delete the datasoures that are saved in the registry (i.e. created using the management console). However, you cannot edit or delete the datasources that are added using configuration files in the <PRODUCT_HOME>/repository/conf/datasources/ directory using the management. For example, to modify the default <WSO2_CARBON_DB> datasource, you have to change the master-datasources.xml file.