public static void removePropertySameAsDefault(DriverConfig driverConfig) {
        if(driverConfig == null){
            return;
        }
        List<KeyValue> customValue = driverConfig.getExtendInfo();
        if (CollectionUtils.isEmpty(customValue)) {
            return ;
        }
        Map<String, String> map = Maps.newHashMap();
        List<KeyValue> result = new ArrayList<>();
        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;
                }
                map.put(propertyInfo.name, propertyInfo.value);
            }
            for (KeyValue keyValue : customValue) {
                if (keyValue == null || StringUtils.isBlank(keyValue.getKey())) {
                    continue;
                }
                String value = map.get(keyValue.getKey());
                if (!StringUtils.equals(value, keyValue.getValue())) {
                    result.add(keyValue);
                }
            }
            Comparator comparator = Collator.getInstance(Locale.ENGLISH);
            Collections.sort(result, (o1, o2) -> comparator.compare(o1.getKey(), o2.getKey()));
            driverConfig.setExtendInfo(result);
        } catch (SQLException 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