Skip to content

Commit c2fed6e

Browse files
committed
StatementCreatorUtils detects Microsoft SQL Server driver 4.0 as well
Issue: SPR-13772 (cherry picked from commit d2ad2c3)
1 parent 242acda commit c2fed6e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spring-jdbc/src/main/java/org/springframework/jdbc/core/StatementCreatorUtils.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -282,7 +282,8 @@ private static void setNull(PreparedStatement ps, int paramIndex, int sqlType, S
282282
}
283283
String databaseProductName = dbmd.getDatabaseProductName();
284284
if (databaseProductName.startsWith("Informix") ||
285-
jdbcDriverName.startsWith("Microsoft SQL Server")) {
285+
(jdbcDriverName.startsWith("Microsoft") && jdbcDriverName.contains("SQL Server"))) {
286+
// "Microsoft SQL Server JDBC Driver 3.0" versus "Microsoft JDBC Driver 4.0 for SQL Server"
286287
useSetObject = true;
287288
}
288289
else if (databaseProductName.startsWith("DB2") ||

0 commit comments

Comments
 (0)