wu-sheng closed pull request #1342: Fix Database UrlParser
URL: https://github.com/apache/incubator-skywalking/pull/1342
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/connectionurl/parser/URLParser.java
 
b/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/connectionurl/parser/URLParser.java
index 7cfe12c44..b9781213a 100644
--- 
a/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/connectionurl/parser/URLParser.java
+++ 
b/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/connectionurl/parser/URLParser.java
@@ -36,13 +36,14 @@
 
     public static ConnectionInfo parser(String url) {
         ConnectionURLParser parser = null;
-        if (url.startsWith(MYSQL_JDBC_URL_PREFIX)) {
+        String lowerCaseUrl = url.toLowerCase();
+        if (lowerCaseUrl.startsWith(MYSQL_JDBC_URL_PREFIX)) {
             parser = new MysqlURLParser(url);
-        } else if (url.startsWith(ORACLE_JDBC_URL_PREFIX)) {
+        } else if (lowerCaseUrl.startsWith(ORACLE_JDBC_URL_PREFIX)) {
             parser = new OracleURLParser(url);
-        } else if (url.startsWith(H2_JDBC_URL_PREFIX)) {
+        } else if (lowerCaseUrl.startsWith(H2_JDBC_URL_PREFIX)) {
             parser = new H2URLParser(url);
-        } else if (url.startsWith(POSTGRESQL_JDBC_URL_PREFIX)) {
+        } else if (lowerCaseUrl.startsWith(POSTGRESQL_JDBC_URL_PREFIX)) {
             parser = new PostgreSQLURLParser(url);
         }
         return parser.parse();


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to