JDBC driver configuration

XDM uses the JDBC API to access the source and target databases of your tasks. You must provide suitable JDBC version 4.0 (or higher) drivers for all database systems that you plan to use as the source or target for XDM tasks.

XDM will search for JDBC drivers in the directory xdm-config/jdbc-drivers. Copy all required JDBC driver .jar files into this directory.

You can download JDBC drivers for different relational database systems on the websites of the respective database vendors. The following table shows the file names that are typically used by the database vendors. Note that vendors can choose different file names for future releases of their JDBC drivers.

XDM has a Postgres JDBC driver included in the distribution. This driver is used by default. It’s not necessary to add an extra Postgres JDBC driver to the driver directory.
Table 1. Typical JDBC driver file names(s) for different database systems
Database system Driver file name(s)

Db2 for Linux, UNIX, and Windows

db2jcc4.jar

Db2 for z/OS

db2jcc4.jar and db2jcc_license_cisuz.jar

Oracle

ojdbc7.jar

PostgreSQL

postgresql-<version>.jar

Microsoft SQL Server

mssql-jdbc-<version>.jre11.jar

MySQL

mysql-connector-java-<version>.jar

MariaDB

mariadb-java-client-<version>.jar

Google Big Query

GoogleBigQueryJDBC42.jar plus additional dependencies

When a new driver was added to the driver directory, the docker-composer of XDM must be restarted to register the new driver in XDM.

JDBC Driver configuration for Google Big Query

For being able to use the JDBC driver for Google Big Query that was mentioned above, it is necessary to add some additional dependencies. You can either add them directly into the driver directory or build a super JAR that consists of the actual JDBC driver for Google Big Query and all other necessary dependencies. The latter is recommended. The dependencies that have to be included are listed below.

  • google-api-client from group com.google.api-client (version 2.2.0)

  • google-auth-library-oauth2-http from group com.google.auth (version 1.16.0 or higher)

  • google-http-client-jackson2 from group com.google.http-client (version 1.43.1 or higher)

  • google-api-services-bigquery from group com.google.apis (version v2-rev20230210-2.0.0)

  • google-api-services-iamcredentials from group com.google.apis (version v1-rev20211203-2.0.0)

  • gax from group com.google.api (version 2.23.3 or higher)

  • google-cloud-bigquerystorage from group com.google.cloud (version 2.34.0)

  • guava from group com.google.guava (version 31.1-jre or higher)

  • avro from group org.apache.avro (version 1.11.1)

  • joda-time from group joda-time (version 2.12.5)

Driver directory

The directory where XDM searches for JDBC drivers can be configured with the property xdm.core.jdbc-driver-dir. The default directory is /xdm/config/jdbc-drivers/ which is used when no other value is specified. When changing the default, it must be specified in the environment sections of both, core and dataflow server. The following configuration shows the default setting.

xdm.core.jdbc-driver-dir=/xdm/config/jdbc-drivers/

Additional drivers to load

The property xdm.core.registered-jdbc-driver specifies a comma separated list of additional JDBC driver names to load. This property can only be used in the environment section of the dataflow server and the default is an empty list. IBM’s AS400 and IMS drivers are always implicitly added to this list. Specifying driver names is only necessary if the driver can not be automatically loaded, as it is the case for the two IBM drivers. The following line shows how a driver with the fully qualified name org.vendor.jdbc.someDriverName would be added to the list.

xdm.core.registered-jdbc-driver=org.vendor.jdbc.someDriverName