solve conflict

This commit is contained in:
zyyang 2020-09-17 14:06:39 +08:00
parent 21a03f05fc
commit 804045682c
2 changed files with 3 additions and 9 deletions

View File

@ -49,11 +49,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>

View File

@ -15,8 +15,6 @@
package com.taosdata.jdbc;
import org.apache.commons.lang3.StringUtils;
import java.io.*;
import java.sql.*;
@ -246,7 +244,7 @@ public class TSDBDriver implements java.sql.Driver {
}
public boolean acceptsURL(String url) throws SQLException {
return StringUtils.isNotBlank(url) && url.startsWith(URL_PREFIX);
return (url != null && url.length() > 0 && url.trim().length() > 0) && url.toLowerCase().startsWith(URL_PREFIX);
}
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException {
@ -293,7 +291,8 @@ public class TSDBDriver implements java.sql.Driver {
return null;
}
if (!StringUtils.startsWithIgnoreCase(url, URL_PREFIX) && !StringUtils.startsWithIgnoreCase(url, URL_PREFIX1)) {
String lowerUrl = url.toLowerCase();
if (!lowerUrl.startsWith(URL_PREFIX) && !lowerUrl.startsWith(URL_PREFIX1)) {
return null;
}