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 driver: PostgreSQL JDBC 9.3-1103 or later.
DWS also supports open source ODBC driver: PostgreSQL ODBC 09.01.0200 or later.
Downloading the JDBC Driver
- Log in to the DWS console.
- In the navigation pane on the left, choose Cluster > Management > Client Connections.
- In the Driver area, select the corresponding version and click Download to download the JDBC driver that matches the cluster version. Select DWS JDBC Driver from the drop-down list box 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. The JDBC driver can be used on all platforms and depends on JDK 1.8.0 or later.
- 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.
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 Dedicated Clusters page, click the name of the specified cluster to go to the Cluster Information page and view the cluster version.
Table 1 JDBC driver download links Driver
Download Link
Verification File
DWS JDBC Driver
DWS Arm JDBC driver
- (Method 2) Download the SDK software package by configuring the Maven repository.
- Go to the Maven repository.
- 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.) The version number of the gsjdbc200.jar driver JAR package is suffixed with x.x.x-200. Click a specified version number to go to the following page. 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>
- gsjdbc4.jar
- (Method 3) Configure dependencies by configuring gradle.
Obtain the Maven repository information by referring to method 2 and add that information in the gradle configuration file.
- gsjdbc4.jar
1implementation("com.huaweicloud.dws:huaweicloud-dws-jdbc:8.5.1") - gsjdbc200.jar
implementation("com.huaweicloud.dws:huaweicloud-dws-jdbc:8.5.1-200")
- gsjdbc4.jar
Downloading the ODBC Driver
- Log in to the DWS console.
- In the navigation pane on the left, choose Cluster > Management > Client Connections.
- In the Driver area, select the corresponding version and click Download to download the ODBC driver that matches the cluster version. The ODBC driver is incompatible with Windows Server 2016.
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.
Table 2 ODBC driver download links OS
Download Link
Verification File
Windows
EulerOS Arm
Red Hat Arm
Redhat x86_64
SUSE x86_64
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot
