public static void setDriverDefaultProperty(DriverConfig driverConfig) {
        if(driverConfig == null){
            return;
        }
        List<KeyValue> defaultKeyValues = driverConfig.getExtendInfo();
        Map<String, KeyValue> valueMap = Maps.newHashMap();
        if (!CollectionUtils.isEmpty(defaultKeyValues)) {
            for (KeyValue keyValue : defaultKeyValues) {
                if (keyValue == null || StringUtils.isBlank(keyValue.getKey())) {
                    continue;
                }
                valueMap.put(keyValue.getKey(), keyValue);
            }
        }
        try {
            DriverPropertyInfo[] propertyInfos = IDriverManager.getProperty(driverConfig);
            if (propertyInfos == null) {
                return;
            }
            for (int i = 0; i < propertyInfos.length; i++) {
                DriverPropertyInfo propertyInfo = propertyInfos[i];
                if (propertyInfo == null) {
                    continue;
                }
                KeyValue keyValue = valueMap.get(propertyInfo.name);
                if (keyValue != null) {
                    String[] choices = propertyInfo.choices;
                    if (CollectionUtils.isEmpty(keyValue.getChoices()) && choices != null && choices.length > 0) {
                        keyValue.setChoices(Lists.newArrayList(choices));
                    }
                } else {
                    keyValue = new KeyValue();
                    keyValue.setKey(propertyInfo.name);
                    keyValue.setValue(propertyInfo.value);
                    keyValue.setRequired(propertyInfo.required);
                    String[] choices = propertyInfo.choices;
                    if (choices != null && choices.length > 0) {
                        keyValue.setChoices(Lists.newArrayList(choices));
                    }
                    valueMap.put(keyValue.getKey(), keyValue);
                }
            }
            if (!valueMap.isEmpty()) {
                Comparator comparator = Collator.getInstance(Locale.ENGLISH);
                List<KeyValue> result = new ArrayList<>(valueMap.values());
                Collections.sort(result, (o1, o2) -> comparator.compare(o1.getKey(), o2.getKey()));
                driverConfig.setExtendInfo(result);
            }
        } catch (SQLException e) {
            log.error("get property error:", e);
        }
    }
Test database connection

@param url database connection
@param userName username
@param password password
@param dbType database type
@return
chat2db-server/chat2db-spi/src/main/java/ai/chat2db/spi/util/JdbcUtils.java