This documentation is for WSO2 Carbon 4.4.0. View documentation for the latest release.
Configuring master-datasources.xml - Carbon 4.4.0 - WSO2 Documentation
Due to a known issue do not use JDK1.8.0_151 with WSO2 products. Use JDK 1.8.0_144 until JDK 1.8.0_162-ea is released.
Skip to end of metadata
Go to start of metadata

Users can change the default configurations by editing the <PRODUCT_HOME>/repository/conf/datasources/master-datasources.xml file using the information in the following table. 

XML Elements 

Click on the table and use the left and right arrow keys to scroll horizontally. For sample values, see the Example below the table.

XML elementAttributeDescriptionData typeDefault valueMandatory/Optional
<datasources-configuration>xmlnsThe root element. The namespace is specified as: xmlns:svns="http://org.wso2.securevault/configuration"  Mandatory
<providers> The container element for the datasource providers.  Mandatory


 The datasource provider, which should implement org.wso2.carbon.ndatasource.common
. The datasources follow a pluggable model in providing datasource type implementations using this approach.
Fully qualified Java class Optional
<datasources> The container element for the datasources.  Mandatory
<datasource> The root element of a datasource.  Mandatory
<name> Name of the datasource.String Mandatory
<description> Description of the datasource.String Optional
<jndiConfig> The container element that allows you to expose this datasource as a JNDI datasource.  Optional
<name> The JNDI resource name to which this datasource will be bound.String Mandatory if specifying JNDI configuration

The container element in which you specify the following JNDI properties:

  • java.naming.factory.initial:  Selects the registry service provider as the initial context.
  • java.naming.provider.url: Specifies the location of the registry when the registry is being used as the initial context.
Fully qualified Java class Optional
<definition>typeThe container element for the data source definition. Set the type attribute to RDBMS, or to custom if you're creating a custom type. The "RDBMS" data source reader expects a "configuration" element with the sub-elements listed below.String Mandatory
<configuration> The container element for the RDBMS properties.  Mandatory if definition type is RDBMS
<url> The connection URL to pass to the JDBC driver to establish the connection.URL Mandatory
<username> The connection user name to pass to the JDBC driver to establish the connection.String Optional
<password> The connection password to pass to the JDBC driver to establish the connection.String Optional
<driverClassName> The class name of the JDBC driver to use.Fully qualified Java class Mandatory
<maxActive> The maximum number of active connections that can be allocated from this pool at the same time.Integer100Optional
<maxWait> Maximum number of milliseconds that the pool waits (when there are no available connections) for a connection to be returned before throwing an exception.Integer30000 (30 seconds)Optional
<testOnBorrow> Specifies whether objects will be validated before being borrowed from the pool. If the object fails to validate, it will be dropped from the pool, and we will attempt to borrow another.
When set to true, the validationQuery parameter must be set to a non-null string.
<validationQuery> The SQL query used to validate connections from this pool before returning them to the caller. If specified, this query does not have to return any data, it just can't throw a SQLException. The default value is null. Example values are SELECT 1(mysql), select 1 from dual(oracle), SELECT 1(MS Sql Server).StringnullMandatory when testOnBorrow is set to true
<validationInterval> To avoid excess validation, only run validation at most at this frequency (interval time in milliseconds). If a connection is due for validation, but has been validated previously within this interval, it will not be validated again. The default value is 30000 (30 seconds).Long30000 (30 seconds)Optional


<datasources-configuration xmlns:svns="http://org.wso2.securevault/configuration">
      <description>The datasource used for registry and user manager</description>
      <definition type="RDBMS">
          <validationQuery>SELECT 1</validationQuery>
  • No labels