From 3d47cb79802f194d1d18492b734ad935ccfcd9de Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Mon, 21 Oct 2024 18:56:22 -0700 Subject: [PATCH] Polish 'Add support for ClickHouse in `DatabaseDriver` enum' See gh-42815 --- .../spring-boot-dependencies/build.gradle | 11 ----------- spring-boot-project/spring-boot-parent/build.gradle | 7 +++++++ .../org/springframework/boot/jdbc/DatabaseDriver.java | 2 ++ 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index 0368953278..ce382ada11 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -205,17 +205,6 @@ bom { site("https://github.com/FasterXML/java-classmate") } } - library("ClickHouse", "0.6.5") { - group("com.clickhouse") { - modules = [ - "clickhouse-jdbc" - ] - } - links { - site("https://clickhouse.com") - releaseNotes("https://github.com/ClickHouse/clickhouse-java/releases/tag/v{version}") - } - } library("Commons Codec", "${commonsCodecVersion}") { group("commons-codec") { modules = [ diff --git a/spring-boot-project/spring-boot-parent/build.gradle b/spring-boot-project/spring-boot-parent/build.gradle index 9869833911..2f9173cd0d 100644 --- a/spring-boot-project/spring-boot-parent/build.gradle +++ b/spring-boot-project/spring-boot-parent/build.gradle @@ -33,6 +33,13 @@ bom { ] } } + library("ClickHouse", "0.6.5") { + group("com.clickhouse") { + modules = [ + "clickhouse-jdbc" + ] + } + } library("Commons Compress", "1.25.0") { group("org.apache.commons") { modules = [ diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/DatabaseDriver.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/DatabaseDriver.java index 0fb5233393..07f582f5b3 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/DatabaseDriver.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/DatabaseDriver.java @@ -212,10 +212,12 @@ public enum DatabaseDriver { * @since 3.4.0 */ CLICKHOUSE("ClickHouse", "com.clickhouse.jdbc.ClickHouseDriver", null, "SELECT 1") { + @Override protected Collection getUrlPrefixes() { return Arrays.asList("ch", "clickhouse"); } + }; private final String productName;