mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
JdbcUtils support clickhouse. for issue #2294
This commit is contained in:
@@ -110,4 +110,7 @@ public interface JdbcConstants {
|
||||
String ELASTIC_SEARCH = "elastic_search";
|
||||
|
||||
String ELASTIC_SEARCH_DRIVER = "com.alibaba.xdriver.elastic.jdbc.ElasticDriver";
|
||||
|
||||
String CLICKHOUSE = "clickhouse";
|
||||
String CLICKHOUSE_DRIVER = "ru.yandex.clickhouse.ClickHouseDriver";
|
||||
}
|
||||
|
||||
@@ -466,6 +466,8 @@ public final class JdbcUtils implements JdbcConstants {
|
||||
return JdbcConstants.KYLIN_DRIVER;
|
||||
} else if (rawUrl.startsWith("jdbc:elastic:")) {
|
||||
return JdbcConstants.ELASTIC_SEARCH_DRIVER;
|
||||
} else if (rawUrl.startsWith("jdbc:clickhouse:")) {
|
||||
return JdbcConstants.CLICKHOUSE_DRIVER;
|
||||
} else {
|
||||
throw new SQLException("unkow jdbc driver : " + rawUrl);
|
||||
}
|
||||
@@ -555,6 +557,8 @@ public final class JdbcUtils implements JdbcConstants {
|
||||
return PHOENIX;
|
||||
} else if (rawUrl.startsWith("jdbc:elastic:")) {
|
||||
return ELASTIC_SEARCH;
|
||||
} else if (rawUrl.startsWith("jdbc:clickhouse:")) {
|
||||
return CLICKHOUSE;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user