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
pull/8458/head
Phillip Webb 8 years ago
parent 99683dff6f
commit f6db1cbcb2

@ -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);

Loading…
Cancel
Save