Tutorial

Using a generic JDBC connector on IBM Cloud Pak for Data

Import a JAR, create a generic JDBC connection, and use the connection

By

Alice Wang

Archived content

Archive date: 2023-02-09

This content is no longer being updated or maintained. The content is provided “as is.” Given the rapid evolution of technology, some content, steps, or illustrations may have changed.

Generic JDBC enables a variety of connections to different data sources. A generic JDBC connection offers the option to connect to a data source using a different driver from what is pre-built in IBM Cloud Pak for Data, and provides additional properties and support for customized use cases.

Learning objectives

The purpose of this tutorial is to demonstrate how to create a generic JDBC connector in IBM Cloud Pak for Data.

In this tutorial, you will learn how to:

  • (Pre-step) Check that you have the Administrator role
  • Import a JDBC JAR file to IBM Cloud Pak for Data
  • Create a generic JDBC platform connection
  • Use the created generic JDBC connection in a project

Prerequisites

You will need IBM Cloud Pak for Data platform software on-prem.

Note: The generic JDBC connection is supported by IBM Cloud Pak for Data; at the time of this writing, it is not supported by IBM Cloud Pak for Data as a Service.

When using the generic JDBC connector, please ensure that a JDBC driver exists for the data source you would like to connect to.

About the data

For this tutorial, we create an SAP HANA data connection. Please substitute details pertaining to the data connection and its containing data with your own.

Estimated time

Completing this tutorial should take about 10 minutes.

Steps

Step 1. Navigate to IBM Cloud Pak for Data and ensure that you have Administrator access

  1. To upload your JDBC JAR, you must have Administer Platform permissions. You can ensure that you have this role by clicking on your profile on the upper-right corner of IBM Cloud Pak for Data, then clicking Profile > Settings.

    Figure 1

  2. Under Roles, check that you have the Administrator role with Administer Platform under enabled permissions. If you are unable to obtain the Administrator role, you need to ask an administrator to perform Step 2. Upload your JDBC JAR to IBM Cloud Pak for Data.

    Figure 2

Step 2. Upload JDBC JAR to IBM Cloud Pak for Data

  1. To upload a JDBC JAR to IBM Cloud Pak for Data, navigate to Data > Platform connections.

    Figure 3

    With Administer Platform permissions, you should see the JDBC drivers tab.

    Figure 4 Figure 5

  2. Drag and drop the JDBC driver JAR file(s) into the box on the left side of the page. You should see your JAR listed, and after clicking Upload, your JAR file should be listed under Existing files on the right side of the page. Your JAR file is now available for use in IBM Cloud Pak for Data.

    Figure 6 Figure 7

Step 3. Creating a Generic JDBC platform connection

In IBM Cloud Pak for Data, you can create a platform-level or project-level connection. A platform-level connection enables use of the connector across the platform vs a project-level connection, which can only be used in a project.

  1. To create an IBM Cloud Pak for Data platform connection, click on Data > Platform Connections.

    Figure 8

  2. Click on the New connection button.

    Figure 9 Figure 10

  3. From the Add Connection page, click on the Generic JDBC connector, then the Select button, which launches the Create connection page.

  4. Enter the desired name and description (optional) for your generic JDBC SAP HANA connector. The JAR URL drop-down will display all existing JDBC JARs available for use in IBM Cloud Pak for Data. Select the JAR(s) required for a connection.

    Figure 11

  5. Next, enter the required fields for JDBC URL and the JDBC class driver.

    Figure 12

  6. Enter the username and password for the connection.

    Figure 13

  7. Click on Test Connection to see if you can successfully connect.

    Figure 14

  8. Once the test connection is verified, click Create to create the connection. The created SAP HANA (JDBC) connection should display under Platform Connections ready for use in IBM Cloud Pak for Data.

    Figure 15

Step 4. Using the created generic JDBC connector in a project

  1. Navigate to the desired project in IBM Cloud Pak for Data. As you can see, this project has no data assets.

    Figure 16

  2. Click on Add to project and choose Connection from the asset type options.

    Figure 17

  3. Click on the From platform tab to display the connections available; the created SAP HANA (JDBC) connection is displayed. Click on the connection, then the Select button.

    Figure 18

The connection is listed under Data assets available for use in project and can now be used.

Figure 19

Summary and next steps

In this tutorial, you learned how to create a platform-level generic JDBC connector and how to use the connector within a project in IBM Cloud Pak for Data. Next, you can learn more about IBM Cloud Pak for Data.