apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/connectionurl/parser/MssqlJdbcURLParser.java [76:109]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public ConnectionInfo parse() {
        try {
            URLLocation location = fetchDatabaseHostsIndexRange();
            String hosts = url.substring(location.startIndex(), location.endIndex());
            String[] hostSegment = hosts.split(",");
            if (hostSegment.length > 1) {
                StringBuilder sb = new StringBuilder();
                for (String host : hostSegment) {
                    if (host.split(":").length == 1) {
                        sb.append(host).append(":").append(DEFAULT_PORT).append(",");
                    } else {
                        sb.append(host).append(",");
                    }
                }
                return new ConnectionInfo(
                    component, dbType, sb.substring(0, sb.length() - 1), fetchDatabaseNameFromURL());
            } else {
                String[] hostAndPort = hostSegment[0].split(":");
                if (hostAndPort.length != 1) {
                    return new ConnectionInfo(
                        component, dbType, hostAndPort[0], Integer.valueOf(hostAndPort[1]),
                        fetchDatabaseNameFromURL(location.endIndex())
                    );
                } else {
                    return new ConnectionInfo(
                        component, dbType, hostAndPort[0], DEFAULT_PORT, fetchDatabaseNameFromURL(location
                                                                                                      .endIndex()));
                }
            }
        } catch (Exception e) {
            LOGGER.error(e, "parse mssql connection info error, url:{}", url);
            return new ConnectionInfo(component, dbType, url, "UNKNOWN");
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/connectionurl/parser/MssqlJtdsURLParser.java [88:121]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public ConnectionInfo parse() {
        try {
            URLLocation location = fetchDatabaseHostsIndexRange();
            String hosts = url.substring(location.startIndex(), location.endIndex());
            String[] hostSegment = hosts.split(",");
            if (hostSegment.length > 1) {
                StringBuilder sb = new StringBuilder();
                for (String host : hostSegment) {
                    if (host.split(":").length == 1) {
                        sb.append(host).append(":").append(DEFAULT_PORT).append(",");
                    } else {
                        sb.append(host).append(",");
                    }
                }
                return new ConnectionInfo(
                    component, dbType, sb.substring(0, sb.length() - 1), fetchDatabaseNameFromURL());
            } else {
                String[] hostAndPort = hostSegment[0].split(":");
                if (hostAndPort.length != 1) {
                    return new ConnectionInfo(
                        component, dbType, hostAndPort[0], Integer.valueOf(hostAndPort[1]),
                        fetchDatabaseNameFromURL(location.endIndex())
                    );
                } else {
                    return new ConnectionInfo(
                        component, dbType, hostAndPort[0], DEFAULT_PORT, fetchDatabaseNameFromURL(location
                                                                                                      .endIndex()));
                }
            }
        } catch (Exception e) {
            LOGGER.error(e, "parse mssql connection info error, url:{}", url);
            return new ConnectionInfo(component, dbType, url, "UNKNOWN");
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



