The use of java.sql.Driver and java.sql.DriverManager interfaces might require configuration

On Liberty, you can easily connect to a database by configuring a <dataSource> element in your server.xml file and using JNDI lookup in your application. For more information about configuring a data source, see Configuring relational database connectivity in Liberty.

However, if your application must access the database using one of the following methods, additional configuration might be required:

If you use these methods and the database driver is not packaged in the application, you must configure a shared library for the database driver and reference it on the application <classloader> element.

In the server.xml file, define a shared library for the database driver in the <library> element:

<library id="yourDBDriverLib">
<fileset dir="yourDBDriverDir"
includes="yourDBDriver.jar"/>
</library>

Reference the shared library by adding a classloader element that points to the library in your <application> element:

<application ...>
<classloader commonLibraryRef="yourDBDriverLib"/>
</application>