<datasources-configuration xmlns:svns="http://org.wso2.securevault/configuration">

    <providers>
        <provider>org.wso2.micro.integrator.ndatasource.rdbms.RDBMSDataSourceReader</provider>
    </providers>
    <datasources>
        {% for data in datasource %}
        <datasource>
            <name>{{data.id}}</name>
            <description>this database is {{data.id}}</description>
            <jndiConfig>
                <name>jdbc/{{data.id}}</name>
            </jndiConfig>
            <definition type="RDBMS">
                <configuration>
                    {% if data.url is defined %}
                    <url>{{data.url}}</url>
                    {% endif %}
                    {% if data.username is defined %}
                    <username>{{data.username}}</username>
                    {% endif %}
                    {% if data.password is defined %}
                    <password>{{data.password}}</password>
                    {% endif %}
                    {% if data.driver is defined %}
                    <driverClassName>{{data.driver}}</driverClassName>
                    {% endif %}
                    {% if data.dataSourceClassName is defined %}
                    <dataSourceClassName>{{data.dataSourceClassName}}</dataSourceClassName>
                    {% endif %}
                    {% if data.defaultAutoCommit is defined %}
                    <defaultAutoCommit>{{data.defaultAutoCommit}}</defaultAutoCommit>
                    {% endif %}
                    {% if data.dataSourceProps is defined %}
                    <dataSourceProps>
                        {% for property_name,property_value in data.dataSourceProps.items() %}
                        <property name="{{property_name}}">{{property_value}}</property>
                        {% endfor %}
                    </dataSourceProps>
                    {% endif %}
                    {% for property_name,property_value in data.pool_options.items() %}
                    <{{property_name}}>{{property_value}}</{{property_name}}>
                    {% endfor %}
                    {% if data.jmx_enable is defined %}
                    <jmxEnabled>{{data.jmx_enable}}</jmxEnabled>
                    {% endif %}
                </configuration>
            </definition>
        </datasource>
        {% endfor %}
    </datasources>
</datasources-configuration>
