Commit f6db1cbc authored by Phillip Webb's avatar Phillip Webb

Extend Microsoft SQL Server detection

Update Microsoft SQL Server detection logic to retain "SQL SERVER"
support (just in case the server string is driver specific).

See gh-8222
parent 99683dff
......@@ -101,7 +101,16 @@ public enum DatabaseDriver {
* SQL Server.
*/
SQLSERVER("Microsoft SQL Server", "com.microsoft.sqlserver.jdbc.SQLServerDriver",
"com.microsoft.sqlserver.jdbc.SQLServerXADataSource", "SELECT 1"),
"com.microsoft.sqlserver.jdbc.SQLServerXADataSource", "SELECT 1") {
@Override
protected boolean matchProductName(String productName) {
return super.matchProductName(productName)
|| "SQL SERVER".equalsIgnoreCase(productName);
}
},
/**
* Firebird.
......
......@@ -86,6 +86,8 @@ public class DatabaseDriverTests {
.isEqualTo(DatabaseDriver.POSTGRESQL);
assertThat(DatabaseDriver.fromProductName("Microsoft SQL Server"))
.isEqualTo(DatabaseDriver.SQLSERVER);
assertThat(DatabaseDriver.fromProductName("SQL SERVER"))
.isEqualTo(DatabaseDriver.SQLSERVER);
assertThat(DatabaseDriver.fromProductName("DB2")).isEqualTo(DatabaseDriver.DB2);
assertThat(DatabaseDriver.fromProductName("Firebird 2.5.WI"))
.isEqualTo(DatabaseDriver.FIREBIRD);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment