|
|
|
@ -66,12 +66,11 @@ public abstract class StatementCreatorUtils { |
|
|
|
* completely, i.e. to never even attempt to retrieve {@link PreparedStatement#getParameterMetaData()} |
|
|
|
* completely, i.e. to never even attempt to retrieve {@link PreparedStatement#getParameterMetaData()} |
|
|
|
* for {@link StatementCreatorUtils#setNull} calls. |
|
|
|
* for {@link StatementCreatorUtils#setNull} calls. |
|
|
|
* <p>The default is "false", trying {@code getParameterType} calls first and falling back to |
|
|
|
* <p>The default is "false", trying {@code getParameterType} calls first and falling back to |
|
|
|
* {@link PreparedStatement#setNull} / {@link PreparedStatement#setObject} calls based on well-known |
|
|
|
* {@link PreparedStatement#setNull} / {@link PreparedStatement#setObject} calls based on |
|
|
|
* behavior of common databases. Spring records JDBC drivers with non-working {@code getParameterType} |
|
|
|
* well-known behavior of common databases. |
|
|
|
* implementations and won't attempt to call that method for that driver again, always falling back. |
|
|
|
* <p>Consider switching this flag to "true" if you experience misbehavior at runtime, |
|
|
|
* <p>Consider switching this flag to "true" if you experience misbehavior at runtime, e.g. with |
|
|
|
* e.g. with connection pool issues in case of an exception thrown from {@code getParameterType} |
|
|
|
* a connection pool setting back the {@link PreparedStatement} instance in case of an exception |
|
|
|
* (as reported on JBoss AS 7) or in case of performance problems (as reported on PostgreSQL). |
|
|
|
* thrown from {@code getParameterType} (as reported on JBoss AS 7). |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static final String IGNORE_GETPARAMETERTYPE_PROPERTY_NAME = "spring.jdbc.getParameterType.ignore"; |
|
|
|
public static final String IGNORE_GETPARAMETERTYPE_PROPERTY_NAME = "spring.jdbc.getParameterType.ignore"; |
|
|
|
|
|
|
|
|
|
|
|
@ -266,7 +265,7 @@ public abstract class StatementCreatorUtils { |
|
|
|
} |
|
|
|
} |
|
|
|
else if (databaseProductName.startsWith("DB2") || |
|
|
|
else if (databaseProductName.startsWith("DB2") || |
|
|
|
jdbcDriverName.startsWith("jConnect") || |
|
|
|
jdbcDriverName.startsWith("jConnect") || |
|
|
|
jdbcDriverName.startsWith("SQLServer")|| |
|
|
|
jdbcDriverName.startsWith("SQLServer") || |
|
|
|
jdbcDriverName.startsWith("Apache Derby")) { |
|
|
|
jdbcDriverName.startsWith("Apache Derby")) { |
|
|
|
sqlTypeToUse = Types.VARCHAR; |
|
|
|
sqlTypeToUse = Types.VARCHAR; |
|
|
|
} |
|
|
|
} |
|
|
|
|