Updated on 2024-01-25 GMT+08:00

Locating JDBC Issues

Java Database Connectivity (JDBC) is a unified standard interface for applications to access databases. Applications can use JDBC to connect to databases and execute SQL statements. GaussDB(DWS) supports JDBC 4.0. This section describes how to locate common JCDB faults and rectify the faults.

The causes of JDBC problems are as follows:

  1. Applications or application framework errors
  2. JDBC function errors
  3. Improper database configurations

JDBC problems can be classified into the following types:

  1. An error is reported during execution, and JDBC throws an exception.
  2. The execution duration is abnormally long.
  3. A feature is not supported. The JDBC has not implemented the required JDK interface.

The following table describes JDBC issues in detail.

Table 1 JDBC issues

Type

Cause

Database Connection Fails

The JDBC client configuration is incorrect. For example, the URL format is incorrect, or the user name or password is incorrect.

The network is abnormal.

A JAR package conflict occurs.

The database configuration is incorrect. The remote access permission has not been configured for the database.

Service Execution Exceptions

The input SQL statement is incorrect and is not supported by GaussDB(DWS).

An error occurs during service processing, and an abnormal packet is returned.

Network fault.

The database connection times out, and the socket is closed.

Performance Issues

Slow SQL execution

The result set is too large. As a result, the application segment responds slowly.

The passed SQL statement is too long and the JDBC parsing is slow.

Function Support Issues

The JDK does not provide standard APIs.

The JDBC does not implement the APIs.