Use JDBC drivers with Cloud Data Fusion

This page explains how to use Java Database Connectivity (JDBC) drivers with Cloud Data Fusion pipelines.

When using Cloud Data Fusion, you can connect to your database using the JDBC to do the following, without having to write any code:

  • Read data
  • Transform data
  • Load data into a destination of your choice

To read, load, and transform data, you must upload a JDBC driver to your Cloud Data Fusion instance and configure it so that you can use it in your data pipelines.

Before you begin

Create a Cloud Data Fusion instance.

Open the instance in Cloud Data Fusion

  1. In the Google Cloud console, go to the Cloud Data Fusion page.

  2. To open the instance in the Cloud Data Fusion web interface, click Instances, and then click View instance.

    Go to Instances

Upload a JDBC driver

  1. In the Cloud Data Fusion web interface, click Control Center.
  2. Click the green circle button.
  3. In the Add entity window that opens, in the Driver box, click the Upload button.
    In the Driver box, click the Upload button.
  4. In the Add driver window that opens, upload the JAR file that contains your JDBC driver. Your JAR file must follow the format <name>-<version>.jar. If your JAR file doesn't follow this format, rename it before you upload.
  5. Click Next.
  6. In the Driver configuration tab:

    1. In the Name field, enter a name for your JDBC driver. Make note of the name that you enter because you will need it in later steps. Do not use spaces or special characters in the name.
    2. In the Class name field, enter the official Java class name of the JDBC driver you're using.

      This isn't an exhaustive list of supported drivers. If you use a driver that isn't on this list, be sure that it's compatible with the database you're trying to connect to. Refer to the driver's documentation for the appropriate class name to use.

    3. Optional: Enter a description.
    4. Click Finish.

Use a JDBC driver

  1. Access the Cloud Data Fusion graphical interface. Go to the Cloud Data Fusion Pipeline Studio.
  2. In the left navigation panel, select Source or Sink and click the source or sink of your choice. A rectangle that represents the source or sink appears in the Studio canvas.
  3. Point to the source or sink. Click Properties on the Database source or sink.
    Click the Properties button.
  4. In the Reference name field, enter the name you defined for the driver in the uploading step.
  5. Fill out the rest of the fields in the Configuration tab.

View a JDBC driver

The JDBC drivers that you upload appear as artifacts in the Cloud Data Fusion Control Center. To view a JDBC driver:

  1. Access the Cloud Data Fusion graphical interface. Go to the Cloud Data Fusion Control Center.
  2. In the Filter by drop-down, select Artifacts. An artifact card with your JDBC driver information appears.
    View a JDBC driver.

Delete a JDBC driver

  1. Access the Cloud Data Fusion graphical interface. Go to the Cloud Data Fusion Control Center.
  2. View your JDBC driver. In the Filter by drop-down, select Artifacts.
  3. In the artifact card of your JDBC driver, click the trash button at the bottom.
    Delete a JDBC driver.

What's next