diff --git a/gradle.properties b/gradle.properties index 640e5332d8bb..90a8f7821100 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=3.5.0-SNAPSHOT +version=3.4.0 latestVersion=true spring.build-type=oss 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 19d5307eb9ab..e015c180f691 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 @@ -83,6 +83,19 @@ public enum DatabaseDriver { */ POSTGRESQL("PostgreSQL", "org.postgresql.Driver", "org.postgresql.xa.PGXADataSource", "SELECT 1"), + /** + * Kingbase. + * @since 3.4.0 + */ + KINGBASE("KingbaseES","com.kingbase8.Driver","com.kingbase8.xa.KBXADataSource","SELECT 1") { + + @Override + protected Collection getUrlPrefixes() { + return Collections.singleton("kingbase8"); + } + + }, + /** * Amazon Redshift. * @since 2.2.0 diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jdbc/DatabaseDriverTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jdbc/DatabaseDriverTests.java index 551bb5c1bd20..2178a6cd4d92 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jdbc/DatabaseDriverTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jdbc/DatabaseDriverTests.java @@ -72,6 +72,7 @@ void databaseProductNameLookups() { assertThat(DatabaseDriver.fromProductName("MariaDB")).isEqualTo(DatabaseDriver.MARIADB); assertThat(DatabaseDriver.fromProductName("Oracle")).isEqualTo(DatabaseDriver.ORACLE); assertThat(DatabaseDriver.fromProductName("PostgreSQL")).isEqualTo(DatabaseDriver.POSTGRESQL); + assertThat(DatabaseDriver.fromProductName("KingbaseES")).isEqualTo(DatabaseDriver.KingbaseES); assertThat(DatabaseDriver.fromProductName("Redshift")).isEqualTo(DatabaseDriver.REDSHIFT); assertThat(DatabaseDriver.fromProductName("Microsoft SQL Server")).isEqualTo(DatabaseDriver.SQLSERVER); assertThat(DatabaseDriver.fromProductName("SQL SERVER")).isEqualTo(DatabaseDriver.SQLSERVER); @@ -99,6 +100,8 @@ void databaseJdbcUrlLookups() { .isEqualTo(DatabaseDriver.ORACLE); assertThat(DatabaseDriver.fromJdbcUrl("jdbc:postgresql://127.0.0.1:5432/sample")) .isEqualTo(DatabaseDriver.POSTGRESQL); + assertThat(DatabaseDriver.fromJdbcUrl("jdbc:kingbase8://localhost:54321/test")) + .isEqualTo(DatabaseDriver.POSTGRESQL); assertThat(DatabaseDriver .fromJdbcUrl("jdbc:redshift://examplecluster.abc123xyz789.us-west-2.redshift.amazonaws.com:5439/sample")) .isEqualTo(DatabaseDriver.REDSHIFT);