Connecting to data sources with a generic JDBC driver in Watson Query

Use the Generic JDBC connector to connect to a data source that does not have a connector that is defined for IBM Cloud Pak® for Data.

Before you begin

Check the prerequisites for the connector to learn if a JDBC driver is required.
Required permissions
To import or delete JDBC drivers, you must have the following permissions:
  • Administer platform
  • Manage configurations

If you need to connect to unsupported data sources, a Cloud Pak for Data administrator with the administer platform permission must upload the JDBC driver for the data source to the web client.

Locate the JAR file for the JDBC driver that you downloaded when you configured your first connection to your unsupported data source. You need this JAR file to upload it to the Cloud Pak for Data web client.

Procedure

To connect to a data source with a generic JDBC driver in Watson Query, follow these steps.

  1. On the navigation menu, click Data > Data virtualization. The service menu opens to the Data sources page by default.

  2. Click Add connection > New connection to see a list of data sources that can be added to Watson Query.

  3. Select the Generic JDBC connector.

  4. Specify the following information.
    • Connection name
    • Connection description
  5. To upload a generic JDBC driver JAR file, complete the following steps.
    1. Click Upload new file.
    2. Drag a JAR file or browse to the JAR file of your generic JDBC driver. Click Upload. The JAR file is listed when the upload completes. Click Close.
    3. Select the uploaded JAR file from the menu to complete the entry of the JAR URI field.
    4. Complete the required entries in the Connection details section.
      Refer to the following examples of JDBC driver and URL formats.
      Microsoft SQL Server
      • Driver Class Name - weblogic.jdbc.ssqlserver.SQLServerDriver
      • URL Prefix - jdbc:bea:sqlserver
      MySQL
      • Driver Class Name - com.mysql.jdbc.Driver
      • URL Prefix - jdbc:mysql
      Oracle
      • Driver Class Name - oracle.jdbc.driver.OracleDriver
      • URL Prefix - jdbc:oracle
      PostgreSQL
      • Driver Class Name - org.postgresql.Driver
      • URL Prefix - jdbc:postgresql
      Spark SQL
      • Driver Class Name - com.ibm.jdbc.sparksql.SparkSQLDriver
      • URL Prefix - jdbc:ibm:sparksql

      Follow the JDBC driver vendor's documentation to confirm extra properties to include. For more information, see Generic JDBC connection: Connection details section.

  6. In the Credentials section, specify the username and password that allow access to the data source.

  7. If you want to use SSL to connect to the database, copy the content of the SSL certificate and paste it in the corresponding box.

    Some data sources can use an SSL certificate that is stored as a secret. If you are using secrets from an external vault, you must have the appropriate permissions to connect to external vaults or an administrator must share the appropriate secrets with you. For more information, see Managing secrets and vaults.

  8. Click Create to add the connection to the data source environment.

  9. Optional: Select a remote connector to associate to the data source and click Add to connector.

    For more information, see Accessing data sources by using remote connectors in Watson Query.

Results

You can now use your connection in Watson Query.