DEV Community

leo
leo

Posted on

Introduction to JDBC package, driver class and environment class provided by openGauss

JDBC package
openGauss provides two kinds of JDBC jar packages: postgresql.jar and openGauss-jdbc-xxxjar. The functions of the two jar packages are the same, just to resolve the JDBC driver package name conflict with PostgreSQL.

Execute build.sh in the source code directory of the Linux server to obtain the driver jar packages postgresql.jar and opengauss-jdbc-xxxjar, which are located in the output directory in the source code. It can also be obtained from the release package on the official website, the package name is openGauss-xxx-JDBC.tar.gz.

The driver package is compatible with PostgreSQL, and the class name and class structure are completely consistent with the PostgreSQL driver. Applications that used to run on PostgreSQL can be directly transplanted to the current system for use.

driver class
illustrate:

openGauss is compatible with the use of PG in the use of JDBC. When loading PostgreSQL and openGauss JDBC drivers with the same name in the same JVM virtual machine, there may be a conflict of org.postgresql.Driver driver class.

Compared with the PG driver, the openGauss JDBC driver has mainly enhanced the following features:

Support SHA256 encrypted login.

Supports docking with third-party logging frameworks that implement the sf4j interface.

Support disaster recovery switching.

Environment
The client needs to configure JDK1.8, the configuration method is as follows:

Enter "java -version" in the DOS window to check the JDK version and confirm that it is JDK1.8. If JDK is not installed, please download the installation package from the official website and install it.

Configure system environment variables according to the following steps.

a. Right-click My Computer and select Properties.

b. Click Advanced System Settings in the left navigation bar of the System page.

c. On the System Properties page, click Environment Variables on the Advanced tab.

d. On the Environment Variables page, click New or Edit in the System Variables area to configure system variables.

Top comments (0)