Skip to main content
Version: v3

Generic JDBC Connector

Generic JDBC Connector is a universal Java database connector that can be used to connect and access various types of relational databases, such as MySQL, PostgreSQL, Oracle, etc. in Java applications. It allows applications to connect to databases via the Java Database Connectivity (JDBC) API and execute SQL queries and commands.

Requirements

Before using Generic JDBC Connector, you need:

  • A JDBC driver for the database or system you want to connect.

Using PostgreSQL as an example for connecting. PostgreSQL JDBC Driver Download Link

Step 1: Create a JDBC Driver

Click on the Settings icon and select the Drives option.

After entering the Drivers page, click the Create a JDBC Driver button.

2_generic_jdbc

Fill in the following configuration information.

3_generic_jdbc

  • Name: The display name of the Driver.
  • Class Name: The name of the Driver class. E.g. for Postgres this would be org.postgresql.Driver.
  • Upload JAR File: The jar file of the Driver.
  • Limit Pushdown: Enables a connector to push processing of such queries of unsorted record to the underlying data source.
  • Limit Pushdown Clause: (if enabled limit pushdown) select the limit Pushdown clause.
  • Ignore System Schema Pattern: To avoid exploring tables timeout, it can fill out regular expression to ignore system schemas.

After submitting, the created driver will be displayed in the table.

7_generic_jdbc

Step 2: Create a Generic JDBC Data Source

You can create a data source through the following two operations. The first is to click the "+" button on the sidebar Data Source or click the Create a Data Source button on the Overview page to create.

4_generic_jdbc

Step 3: Set connection information

5_generic_jdbc

  • Name: Database name, for display, can be modified later.
  • Data Source Type: Database type, please select Generic JDBC.
  • Driver: Select the driver you want to connect.
  • URI: Please fill in jdbc:<protocal>://<host>:<port>/databaseName format, for example jdbc:postgresql://10.10.0.9:3432/tpchsf1.
  • Username: Username used for connection.
  • Password: Password used for connection.
  • Unsupported Type Handling: Configure how unsupported column data types are handled.
  • Table Pattern: Can use Java regular expression to filter the tables you want to connect. E.g. public.r.* for selecting all tables under the public schema whose names start with the letter r.
  • Default Scale and Number Rounding Mode: If the Table contains floating point types, such as Double, Float, and the data also has decimal point values, you need to set these two fields.
  • Explore Timeout: If the database contains a large number of Tables, it is recommended to increase this parameter so that the Explorer can wait for a longer time.

Step 4: Complete the build

After submitting, the Generic JDBC data source will show up in the sidebar in a few moments, and you can click to enter the data source details page.

6_generic_jdbc