Updated on 2025-08-25 GMT+08:00

Loading the Driver

Load the database driver before creating a database connection.

There are two methods to load the driver:

  • Implicit loading anywhere in the code before creating a connection: Class.forName("org.postgresql.Driver").
  • Parameter passing during JVM startup: java -Djdbc.drivers=org.postgresql.Driver jdbctest.
    • In the above, jdbctest refers to the name of the test case program.
    • When using gsjdbc200.jar, modify the driver class name accordingly to com.huawei.gauss200.jdbc.Driver.