JdbcUtils support clickhouse. for issue #2294

This commit is contained in:
wenshao
2018-01-30 09:41:46 +08:00
parent c482bbe762
commit e3ededf08e
2 changed files with 7 additions and 0 deletions
@@ -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;
}