private static Connection establishDatabaseConnection(String url, String user, String password) throws Exception {
        Connection conn;
        try {
            Class.forName(POSTGRES_DRIVER_CLASS);
            conn = DriverManager.getConnection(url, user, password);
        } catch (Exception e) {
            String errorMsg =
                    "get PostgreSQL connection error, please check PostgreSQL JDBC URL, username, or password";
            LOG.error(errorMsg, e);
            throw new Exception(errorMsg + ": " + e.getMessage());
        }

        if (conn == null) {
            throw new Exception("get PostgreSQL connection failed, please contact administrator");
        }
        LOG.info("get PostgreSQL connection success, url={}", url);
        return conn;
    }
Establishes a PostgreSQL database connection using the provided URL, username, and password.

@param url      The PostgreSQL JDBC URL
@param user     The username
@param password The user's password
@return A {@link Connection} representing the PostgreSQL database connection
@throws Exception If an error occurs during connection establishment
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/resource/sink/postgresql/PostgreSQLJdbcUtils.java