JDBC drivers with Cloud Data Fusion

In Cloud Data Fusion, you can connect to your database using JDBC, to read data, transform it, and load it into a destination of your choice, without having to write any code to do so. However, due to licensing restrictions, Data Fusion does not provide any JDBC drivers from vendors by default. As a result, you have to upload the driver to your Data Fusion instance, and configure it so that you can use it in data pipelines. This document provides a step-by-step guide of how to use JDBC drivers with data pipelines.

Instructions

Uploading a driver

  1. On any of the pipelines pages on Cloud Data Fusion, click the green plus button.

  2. In the Add Entity window, click the Upload button in the Driver box.

 

3. In the Add Driver modal, upload the JAR file containing your JDBC driver, and then click Next.

Currently, Cloud Data Fusion requires that the JDBC Driver JAR file has the format <name>-<version>.jar. If your driver currently does not have a version number, please rename it to add the version number before uploading it.

4. In the Driver Configuration tab, provide configurations for the JDBC driver:

  • Name: Enter a name that you will use to identify the driver (Do not use spaces or special characters here). Please note the name you entered in this step.

  • Class Name: Enter the fully qualified Java class name of the JDBC driver inside your driver JAR. The table below lists class names for some common JDBC drivers.

Database Driver

Class Name

Oracle Thin

oracle.jdbc.driver.OracleDriver

Oracle Database

oracle.jdbc.OracleDriver

MySQL

com.mysql.jdbc.Driver

Microsoft SQL Server (v6.2 and later)

com.microsoft.sqlserver.jdbc.SQLServerDriver

PostgreSQL (v6.5 and earlier)

postgresql.Driver

PostgreSQL (v7.0 and later)

org.postgresql.Driver

Google Cloud SQL for PostgreSQL

org.postgresql.Driver

Google Cloud SQL for MySQL

com.mysql.jdbc.Driver

SAP Hana

com.sap.db.jdbc.Driver

Amazon Redshift

com.amazon.redshift.jdbc.Driver

IBM DB2

com.ibm.db2.jcc.DB2Driver

Netezza

org.netezza.Driver

Teradata

com.teradata.jdbc.TeraDriver

Hiveserver 2 (Unsecured Binary)

org.apache.hive.jdbc.HiveDriver

Hiveserver 2 (Unsecured HTTP)

org.apache.hive.jdbc.HiveDriver

5. (Optional) Enter a description.

6. Click Finish.

Once this is done, the JDBC driver should be available for use with the Database source and sink plugins in your Cloud Data Fusion pipeline. 

Using a JDBC driver

  1. Open the Pipeline Studio.

  2. Select a database source or sink plugin from the Sources or Sinks section of the plugin palette on the left.

  3. Click the Properties button on the database source/sink.

  4. In the Plugin Name configuration, enter the name that you had defined for the driver in the previous step.

  5. Fill out the rest of the configuration of your database plugin.

Viewing a JDBC driver

Uploaded JDBC drivers are available as artifacts in Cloud Data Fusion. They can be found in the Control Center by selecting the Artifacts checkbox in the Filter by dropdown. For example, the SAP Hana JDBC Driver appears as:

 

Deleting a JDBC driver

In the Control Center, you can delete a JDBC driver by clicking the Trash button on its card.

Related articles