diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/support/JdbcUtils.java b/spring-jdbc/src/main/java/org/springframework/jdbc/support/JdbcUtils.java index 9fb4cd4abb..ecfa2d23dd 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/support/JdbcUtils.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/support/JdbcUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,6 +49,7 @@ import org.springframework.util.StringUtils; * * @author Thomas Risberg * @author Juergen Hoeller + * @author Ben Blinebury */ public abstract class JdbcUtils { @@ -455,9 +456,6 @@ public abstract class JdbcUtils { if (source != null && source.startsWith("DB2")) { name = "DB2"; } - else if ("MariaDB".equals(source)) { - name = "MySQL"; - } else if ("Sybase SQL Server".equals(source) || "Adaptive Server Enterprise".equals(source) || "ASE".equals(source) || diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/support/JdbcUtilsTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/support/JdbcUtilsTests.java index 70051932c9..7b7c3c10c5 100644 --- a/spring-jdbc/src/test/java/org/springframework/jdbc/support/JdbcUtilsTests.java +++ b/spring-jdbc/src/test/java/org/springframework/jdbc/support/JdbcUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat; * * @author Thomas Risberg * @author Juergen Hoeller + * @author Ben Blinebury */ public class JdbcUtilsTests { @@ -37,6 +38,7 @@ public class JdbcUtilsTests { assertThat(JdbcUtils.commonDatabaseName("Sybase SQL Server")).isEqualTo("Sybase"); assertThat(JdbcUtils.commonDatabaseName("Adaptive Server Enterprise")).isEqualTo("Sybase"); assertThat(JdbcUtils.commonDatabaseName("MySQL")).isEqualTo("MySQL"); + assertThat(JdbcUtils.commonDatabaseName("MariaDB")).isEqualTo("MariaDB"); } @Test