Adding JDBC driver information for a data source

Add JDBC driver information to the JDBC Gateway.

Before you begin

The JDBC Gateway must be installed, the JDBC Gateway server must be active, and the JDBC Gateway administrative console must be launched. See Installing the JDBC Gateway.

About this task

The JDBC Gateway requires a compliant JDBC driver for each data source to be accessed. You must locate and add JDBC driver information for each data source. The driver files must be accessible to the JDBC Gateway. The JDBC Gateway retains the defined JDBC driver information, and you would only repeat this specification process to add new drivers or make changes to the properties of an existing driver.

In preparation for this task, obtain the following driver information for the data source from the data source vendor or from the driver documentation:
  • Driver class name. For example: org.postgresql.Driver
  • Driver JAR files
  • URL format. Each data source type has a unique URL format that is used to access the data and is specific by vendor. For example, for Postgres: jdbc:postgresql://{host}:{port}/{database}

To add JDBC driver information to the JDBC Gateway, using the JDBC Gateway administrative console, you will define the driver library for the data source, and then add the driver files to the library. Use the following procedure to add JDBC driver information for a data source.

Procedure

  1. In the JDBC Gateway administrative console, select Preferences > JDBC Libraries.
    The following table describes the areas of the page:
    Area Description
    JDBC driver libraries JDBC driver libraries that are already set up. Use the search bar to quickly locate information in the table.
    Driver files JAR files associated with selected driver library.
    Details Additional information about the selected driver library
  2. Add a driver library by performing the following steps:
    1. Click the Add Driver button.
    2. In the Add New Driver Library window, provide the following information:
      Field Action
      Enter new library name Enter a name for the library. The JDBC driver information for each type of database is organized by libraries. It is recommended that the name that you specify describes the JDBC information that will be included in the library. For example, if you are adding JDBC driver information for accessing Postgres databases, you might call the library Postgres. However, this is a descriptive field and can include any text.
      Driver class name Specify the actual name of the driver class that will be used. This information can be found in your JDBC driver documentation. For example: org.postgresql.Driver
      URL templates Optional: Specify a generic example of a correctly formatted URL that could be used to connect to the database. For example, if you are adding JDBC driver information for accessing Postgres databases, you might specify the following JDBC URL template: jdbc:postgresql://{host}:{port}/{database}. The generic information as specified in the template is presented when you are adding data sources, where you will replace the generic information with the specific database information.
      Note: The Validate and JDBC Driver Properties options are not applicable until the driver files have been added.
    3. Click OK.
  3. Add JDBC driver files to the library by performing the following steps:
    1. Click the Add Driver Files button.
    2. In the Add Files dialog, click Add and specify the path to the JDBC driver files to add.
    3. Click OK.
  4. Optional: Update JDBC driver information as follows:
    • To edit the JDBC driver library information, validate the drivers, or add connection keywords, select an existing JDBC driver library from the list and click Edit Driver. The Edit Driver Library window opens where you can make changes to the library name, class name, and URL templates. You can also use the Validate option to validate the driver files, and the JDBC Driver Properties option to enter driver-specific connection keywords.
    • To remove a JDBC driver library, select an existing JDBC driver library from the list and click Remove Driver. The library, including all the JAR files that it contains, is removed.
    • To remove a JAR file from a JDBC driver library, select an existing file from the list and click Remove Driver File. The file is removed.
  5. Click OK.

Results

The JDBC driver information is saved.
Note: You must repeat this process for each JDBC driver that will be used to access a data source type.

What to do next

Create the data source definition entry, specifying the location name, driver, URL, and user information. Creating a data source definition entry.