Updated on 2024-09-30 GMT+08:00

JDBC Package and Driver Class

JDBC Package

Obtain a JDBC package from the release package. The package name is dws_8.x.x_jdbc_driver.zip. For more information, see Downloading Drivers.

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. If two JDBC drivers are used in the same process, class names may conflict.