Skip to content

Commit a385153

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

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.
@@ -281,7 +281,8 @@ private static void setNull(PreparedStatement ps, int paramIndex, int sqlType, S
281281
}
282282
String databaseProductName = dbmd.getDatabaseProductName();
283283
if (databaseProductName.startsWith("Informix") ||
284-
jdbcDriverName.startsWith("Microsoft SQL Server")) {
284+
(jdbcDriverName.startsWith("Microsoft") && jdbcDriverName.contains("SQL Server"))) {
285+
// "Microsoft SQL Server JDBC Driver 3.0" versus "Microsoft JDBC Driver 4.0 for SQL Server"
285286
useSetObject = true;
286287
}
287288
else if (databaseProductName.startsWith("DB2") ||

0 commit comments

Comments
 (0)