提交 b60e66bb 编写于 作者: H Haojun Liao

[td-1409] remove the dependency of JDBC driver on common-util package. #3459

上级 82714623
...@@ -48,11 +48,6 @@ ...@@ -48,11 +48,6 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
......
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
*****************************************************************************/ *****************************************************************************/
package com.taosdata.jdbc; package com.taosdata.jdbc;
import org.apache.commons.lang3.StringUtils;
import java.sql.*; import java.sql.*;
import java.util.Properties; import java.util.Properties;
import java.util.logging.Logger; import java.util.logging.Logger;
...@@ -42,9 +40,8 @@ import java.util.logging.Logger; ...@@ -42,9 +40,8 @@ import java.util.logging.Logger;
public class TSDBDriver implements java.sql.Driver { public class TSDBDriver implements java.sql.Driver {
@Deprecated @Deprecated
private static final String URL_PREFIX1 = "jdbc:TSDB://"; private static final String URL_PREFIX1 = "jdbc:tsdb://";
private static final String URL_PREFIX = "jdbc:taos://";
private static final String URL_PREFIX = "jdbc:TAOS://";
/** /**
* Key used to retrieve the database value from the properties instance passed * Key used to retrieve the database value from the properties instance passed
...@@ -188,7 +185,7 @@ public class TSDBDriver implements java.sql.Driver { ...@@ -188,7 +185,7 @@ public class TSDBDriver implements java.sql.Driver {
} }
public boolean acceptsURL(String url) throws SQLException { 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 { public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException {
...@@ -238,7 +235,8 @@ public class TSDBDriver implements java.sql.Driver { ...@@ -238,7 +235,8 @@ public class TSDBDriver implements java.sql.Driver {
return null; 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; return null;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册