+

Search Tips   |   Advanced Search

Configuration differences between the full profile and Liberty profile: dataSource and jdbcDriver elements


Data source properties with different names


Data source properties with different values


connectionSharing property of data sources


Time duration properties of data source

Time duration properties can optionally be specified with units in the Liberty profile. For example,

<dataSource id="informix" jndiName="jdbc/informix" queryTimeout="5m"  ...>
        <properties.informix ifxIFX_LOCK_MODE_WAIT="120s" .../>
    </dataSource>
See Configuration elements in server.xml for accepted time units and formats of dataSource element. Omitting the units in the Liberty profile is equivalent to the default units used in the full profile.


Configuration for JDBC drivers

For some of the commonly used JDBC drivers, the Liberty profile infers the data source implementation class names based on the names the driver JARs. Therefore, we can omit the implementation class names. For example:

<jdbcDriver id="Derby" libraryRef="DerbyLib"/>
<library id="DerbyLib"> 
       <fileset dir="C:/Drivers/derby" includes="derby.jar" />
</library>

Use the optional properties of the default implementation classes to override these classes such as javax.sql.DataSource, javax.sql.ConnectionPoolDataSource, and javax.sql.XADataSource.

The following example shows how to override the default javax.sql.XADataSource and javax.sql.ConnectionPoolDataSource implementations that the Liberty profile selects

<jdbcDriver id="Derby" 
                     libraryRef="DerbyLib" 
                     javax.sql.XADataSource="org.apache.derby.jdbc.EmbeddedXADataSource" 
                     javax.sql.ConnectionPoolDataSource="org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource"/>

<library id="DerbyLib"> 
      <fileset dir="C:/Drivers/derby" includes="derby.jar" />
</library>
See Configuration elements in server.xml for more information about the jdbcDriver element.


Parent topic: Migrate data access applications to the Liberty profile