Skip to content

Commit e1bdf55

Browse files
committed
StatementCreatorUtils always tries getParameterType on Oracle 12c driver
Issue: SPR-13825 (cherry picked from commit e48ec4f)
1 parent deae872 commit e1bdf55

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,11 @@ private static void setNull(PreparedStatement ps, int paramIndex, int sqlType, S
277277
if (jdbcDriverName == null) {
278278
jdbcDriverName = dbmd.getDriverName();
279279
}
280-
if (checkGetParameterType) {
280+
if (checkGetParameterType &&
281+
!(jdbcDriverName.startsWith("Oracle") && dbmd.getDriverMajorVersion() >= 12)) {
282+
// Register JDBC driver with no support for getParameterType, except for the
283+
// Oracle 12c driver where getParameterType fails for specific statements only
284+
// (so an exception thrown above does not indicate general lack of support).
281285
driversWithNoSupportForGetParameterType.add(jdbcDriverName);
282286
}
283287
String databaseProductName = dbmd.getDatabaseProductName();

0 commit comments

Comments
 (0)