IBM Worklight v5.0.5 > Develop IBM Worklight applications > Develop the server side of an IBM Worklight application > The adapter XML File

The <connectionPolicy> element of the SQL adapter

The connection policy of an SQL adapter is configured in two places:

Configure the policy in

In all properties, n can be 1 - 10, such as...

Property Description
custom-db.n.relative-jndi-name Relative JNDI name of the database. This is the part of the JNDI name that is prefixed by...


For example, if the full JNDI name is...


...the relative JNDI name is mydatabase.

custom-db-n.driver JDBC driver to the database. The JDBC driver of MySQL, for example, is...


The driver must be placed in...

custom-db.n.url JDBC connection string to the database. For example:

custom-db.n.username User name used to connect to the database.
custom-db.n.password User password used to connect to the database.

Configure the adapter XML file

In the adapter XML configuration file, configure the <ConnectionPolicy> element.

<connectionPolicy xsi:type="sql:SQLConnectionPolicy">
    <dataSourceJNDIName> java:comp/env/relative-jndi-name </dataSourceJNDIName>

Attribute Description
xsi:type . The value of this attribute must be set to sql:SQLConnectionPolicy.

Subelement Description
dataSourceJNDIName . The JNDI name (the data source name), as defined in

In the reference example, the <ConnectionPolicy> element is defined as follows:

<connectionPolicy xsi:type="sql:SQLConnectionPolicy">

Parent The adapter XML File