Updated on 2025-09-11 GMT+08:00

Downloading the JDBC or ODBC Driver

The JDBC or ODBC driver is used to connect to data warehouse clusters. You can download the JDBC or ODBC driver provided by DWS from the console or use the open-source JDBC or ODBC driver.

Open-Source JDBC or ODBC Driver

DWS also supports open-source JDBC and ODBC drivers: PostgreSQL JDBC 9.3-1103 or later; PostgreSQL ODBC 09.01.0200 or later.

Downloading the JDBC or ODBC Driver

  1. Log in to the DWS console.
  2. In the navigation pane on the left, choose Dedicated Clusters > Management > Client Connections.
  3. In the Driver area, choose a driver that you want to download.

    • JDBC Driver

      Method 1:

      Select DWS JDBC Driver and click Download to download the JDBC driver matching the current cluster version. The driver package name is dws_9.1.x_jdbc_driver.zip. After the package is decompressed, there will be two JAR packages gsjdbc4.jar and gsjdbc200.jar.

      • gsjdbc4.jar: The gsjdbc4.jar driver package is compatible with PostgreSQL. Its class names and class structures are the same as those of the PostgreSQL driver. Applications that run in PostgreSQL can be directly migrated to the current system.
      • gsjdbc200.jar: If a JVM process needs to access PostgreSQL and DWS at the same time, this driver package must be used. In this package, the main class name is com.huawei.gauss200.jdbc.Driver (that is, org.postgresql is replaced with com.huawei.gauss200.jdbc). The URL prefix of the database connection is jdbc:gaussdb. Other parameters are the same as those of gsjdbc4.jar.

      If clusters of different versions are available, you will download the JDBC driver matching the earliest cluster version after clicking Download. If there is no cluster, you will download the JDBC driver of the earliest version after clicking Download. DWS clusters are compatible with earlier versions of JDBC drivers.

      Click Historical Version to download the corresponding JDBC driver version. You are advised to download the JDBC driver based on the cluster version.

      The JDBC driver can be used on all platforms and depends on JDK 1.6 or later.

      If you have clusters of different versions, the system displays a dialog box, prompting you to select the cluster version and download the driver corresponding to the cluster version. In the cluster list on the Clusters > Dedicated Clusters page, click the name of the specified cluster to go to the Cluster Information page and view the cluster version.

      Method 2:

      Download the SDK software package by configuring the Maven repository. Go to the Maven repository.

      Figure 1 Maven page

      In the list shown in Figure 1, the version numbers are those of the DWS JDBC driver packages. You can choose the driver package of your required version. (Theoretically, DWS clusters are compatible with any JDBC version. However, new versions include optimizations and fix known issues. Therefore, you are advised to use the latest version. For details about the JDBC versions, see JDBC Version Description.) Click a specified version number to go to the following page:

      The version number of the gsjdbc200.jar driver JAR package is suffixed with x.x.x-200.

      Figure 2 Maven dependency

      Copy the Maven repository information in the lower part of the page and add it to the pom.xml file. For example, add the driver information of JDBC 8.5.1 to the pom.xml file.

      • gsjdbc4.jar
        1
        2
        3
        4
        5
        <dependency>
            <groupId>com.huaweicloud.dws</groupId>
            <artifactId>huaweicloud-dws-jdbc</artifactId>
            <version>8.5.1</version> 
        </dependency>
        
      • gsjdbc200.jar
        <dependency>
            <groupId>com.huaweicloud.dws</groupId>
            <artifactId>huaweicloud-dws-jdbc</artifactId>
            <version>8.5.1-200</version>
        </dependency>  

      Method 3:

      Configure dependencies by configuring gradle.

      Obtain the Maven repository information by referring to method 2 and include it in the gradle configuration file.

      • gsjdbc4.jar
        1
        implementation("com.huaweicloud.dws:huaweicloud-dws-jdbc:8.5.1")
        
      • gsjdbc200.jar
        implementation("com.huaweicloud.dws:huaweicloud-dws-jdbc:8.5.1-200")
    • ODBC Driver

      Select a corresponding version and click Download to download the ODBC driver matching the current cluster version. If clusters of different versions are available, you will download the ODBC driver matching the earliest cluster version after clicking Download. If there is no cluster, you will download the ODBC driver of the earliest version after clicking Download. DWS clusters are compatible with earlier versions of ODBC drivers.

      Click Historical Version to download the corresponding ODBC driver version. You are advised to download the ODBC driver based on the cluster version.

      The ODBC driver is incompatible with Windows Server 2016.