Versions Compared

Key

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

Data source management capability 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 data source management capability is not included in your product by default, you can add it by installing the above feature using the instructions given in section, Feature Management.

A Data Source can be added with InMemory configuration or with JNDI. Follow the instructions below to add a new Data Source to a running Carbon instance.

1. Log on to the product's management console and select "Data Sources."

2. Click on the "Add Data Source" link in the "Data Sources" page.

3. Specify the required options in the "New Data Source" page. Depending on the data source type, the required fields may vary. Discussed below are the two types available.

Default RDBMS
Anchor
rdbms
rdbms

If you select the "Data Source Type" as RDBMS, the following screen will appear.

This is the default RDBMS data source configuration provided by WSO2. Users can also write your own RDBMS configuration by selecting the Custom Data Source option. The following fields should be provided when defining the default RDBMS data source.

  • Data Source Type : RDBMS
  • Name : Name of the data source (This value should be unique.)
  • Data Source Provider : Discussed below.
  • Driver : The JDBC driver to be used.
  • URL : The connection URL to be passed to the JDBC driver to establish a connection.
  • User Name : The connection user name to be passed to the JDBC driver to establish a connection.
  • Password : The connection password to be passed to the JDBC driver to establish a connection.
  • Expose as a JNDI Data Source : Discussed below.
  • Data Source Configuration Parameters : Additional properties can be defined when creating an RDBMS data source. For more information on these properties, refer to section Properties of RDBMS Data Sources.

The meaning of many fields is similar to the DBCPconfiguration guide, to which you can refer for more information: http://commons.apache.org/dbcp/configuration.html

4. Once the values are entered, click "Save".

5. You have created a carbon data source.

Data Source Provider
Anchor
pro
pro

There are two types of data source providers. You can use the default provider or link an external provider. For the 'default' Data Source Provider, given connection properties Driver, URL, User Name and Password need to be entered as follows:

If you need to add a data source 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". Given below is an example data source of External Data source Provider with entered values.

JNDI Data Source
Anchor
jndi
jndi

Special options of the JNDI configuration:

  • IC Factory - Initial context factory of the JNDI.
  • Provider Port - If specified, it will be used to create a JNDI provider URL internally.
  • Provider URL - The URL of the JNDI provider. It is assumed that this URL exists and is accessible.

For example,

4. Click on the "Add" button to create the new Data Source.

5. The new Data Source appears in the "Data Sources" list.

From here you can edit and delete Data Sources.

Custom Data Source 
Anchor
custom
custom

If you select the "Data Source Type" as Custom, the following screen will appear.


  • Data Source Type : Custom 
  • Custom Data Source Type : The actual type of the custom data source. This can also be RDBMS. 
  • Name : Name of the data source (This value should be unique).
  • Description :
  • Configuration :

Shown below is an example of adding a custom data source of type 'DS_CUSTOM'.


4. Once the values are entered, click "Save".

5. You have created a carbon data source.

Excerpt
hiddentrue

Instructions to add a RDBMS or custom data source to WSO2 products.