Skip to content

Commit 5866773

Browse files
committed
Revise documentation notes on getParameterType performance issues
See gh-25679
1 parent 2d632ef commit 5866773

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ public abstract class StatementCreatorUtils {
7272
* {@link PreparedStatement#setNull} / {@link PreparedStatement#setObject} calls based on well-known
7373
* behavior of common databases. Spring records JDBC drivers with non-working {@code getParameterType}
7474
* implementations and won't attempt to call that method for that driver again, always falling back.
75-
* <p>Consider switching this flag to "true" if you experience misbehavior at runtime, e.g. with
76-
* a connection pool setting back the {@link PreparedStatement} instance in case of an exception
77-
* thrown from {@code getParameterType} (as reported on JBoss AS 7).
75+
* <p>Consider switching this flag to "true" if you experience misbehavior at runtime,
76+
* e.g. with connection pool issues in case of an exception thrown from {@code getParameterType}
77+
* (as reported on JBoss AS 7) or in case of performance problems (as reported on PostgreSQL).
7878
* <p>Note that this flag is "true" by default on Oracle 12c since there can be leaks created by
7979
* {@code getParameterType} calls in such a scenario. You need to explicitly set the flag to
8080
* "false" in order to enforce the use of {@code getParameterType} against Oracle drivers.
@@ -309,7 +309,7 @@ private static void setNull(PreparedStatement ps, int paramIndex, int sqlType, S
309309
}
310310
else if (databaseProductName.startsWith("DB2") ||
311311
jdbcDriverName.startsWith("jConnect") ||
312-
jdbcDriverName.startsWith("SQLServer")||
312+
jdbcDriverName.startsWith("SQLServer") ||
313313
jdbcDriverName.startsWith("Apache Derby")) {
314314
sqlTypeToUse = Types.VARCHAR;
315315
}

0 commit comments

Comments
 (0)