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.
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
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.
Completing this tutorial should take about 10 minutes.
Step 1. Navigate to IBM Cloud Pak for Data and ensure that you have Administrator access
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.
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.
Step 2. Upload JDBC JAR to IBM Cloud Pak for Data
To upload a JDBC JAR to IBM Cloud Pak for Data, navigate to Data > Platform connections.
With Administer Platform permissions, you should see the JDBC drivers tab.
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.
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.
To create an IBM Cloud Pak for Data platform connection, click on Data > Platform Connections.
Click on the New connection button.
From the Add Connection page, click on the Generic JDBC connector, then the Select button, which launches the Create connection page.
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.
Next, enter the required fields for JDBC URL and the JDBC class driver.
Enter the username and password for the connection.
Click on Test Connection to see if you can successfully connect.
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.
Step 4. Using the created generic JDBC connector in a project
Navigate to the desired project in IBM Cloud Pak for Data. As you can see, this project has no data assets.
Click on Add to project and choose Connection from the asset type options.
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.
The connection is listed under Data assets available for use in project and can now be used.
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.