From ec4e6e0b0e84d11f9e5abaf092d5bcb7410d8a52 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 1 Jul 2014 20:30:23 +0200 Subject: [PATCH] StatementCreatorUtils populates NVARCHAR, LONGNVARCHAR, NCLOB via setString as well Issue: SPR-11938 --- .../org/springframework/jdbc/core/StatementCreatorUtils.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/StatementCreatorUtils.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/StatementCreatorUtils.java index 496531df3f..1e4439e11b 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/StatementCreatorUtils.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/StatementCreatorUtils.java @@ -318,8 +318,9 @@ public abstract class StatementCreatorUtils { else if (inValue instanceof SqlValue) { ((SqlValue) inValue).setValue(ps, paramIndex); } - else if (sqlType == Types.VARCHAR || sqlType == Types.LONGVARCHAR || - (sqlType == Types.CLOB && isStringValue(inValue.getClass()))) { + else if (sqlType == Types.VARCHAR || sqlType == Types.NVARCHAR || + sqlType == Types.LONGVARCHAR || sqlType == Types.LONGNVARCHAR || + ((sqlType == Types.CLOB || sqlType == Types.NCLOB) && isStringValue(inValue.getClass()))) { ps.setString(paramIndex, inValue.toString()); } else if (sqlType == Types.DECIMAL || sqlType == Types.NUMERIC) {