Updated on 2024-11-05 GMT+08:00

JDBC Package and Driver Class

JDBC Package

Download the dws_8.1.x_jdbc_driver.zip package from the console.

For details, see Downloading the JDBC or ODBC Driver.

After the decompression, you will obtain the following JDBC packages in .jar format:
  • gsjdbc4.jar: Driver package compatible with PostgreSQL. The class name and class structure in the driver are the same as those in the PostgreSQL driver. All the applications running on PostgreSQL can be smoothly transferred to the current system.
  • gsjdbc200.jar: This driver package is used when both PostgreSQL and GaussDB(DWS) are accessed in a JVM process. The main class name is com.huawei.gauss200.jdbc.Driver and the prefix of the URL for database connection is jdbc:gaussdb. Other information of this driver package is the same as that of gsjdbc4.jar.

Driver Class

Before creating a database connection, you need to load the database driver class org.postgresql.Driver (decompressed from gsjdbc4.jar) or com.huawei.gauss200.jdbc.Driver (decompressed from gsjdbc200.jar).

GaussDB(DWS) is compatible with PostgreSQL in the use of JDBC. Therefore, when two JDBC drivers are used in the same process, class names may conflict.