public static Map<String, String> parseUrlParameters(URL url) {
        Map<String, String> params = new HashMap<>();

        try {
            String path = url.getPath();
            path = path.substring(path.indexOf('/') + 1);
            LOG.debug("path: {}", path);
            if (!path.trim().isEmpty()) {
                params.put("database", path);
            } else {
                params.put("database", "default");
            }

            String query = url.getQuery();
            if (query != null) {
                for (String pair : query.split("&")) {
                    int idx = pair.indexOf("=");
                    if (idx > 0) {
                        params.put(pair.substring(0, idx), pair.substring(idx + 1));
                    }
                }
            }
        } catch (Exception e) {
            LOG.error("Failed to parse URL parameters", e);
        }

        return params;
    }
Parses URL parameters.
@param url
@return Map of parameters
client-v2/src/main/java/com/clickhouse/client/api/internal/HttpAPIClientHelper.java