The only way to avoid LobHandler in DAO code for insert/update:
MapSqlParameterSourceparamSource = newMapSqlParameterSource();
paramSource.addValue("clob", "a long long text", Types.CLOB);
namedTemplate.update(INSERT_STMT, paramSource);
Actual type of table column is NCLOB, and with Type.CLOB code work fine.
My suggestion just add NCLOB to src/main/java/org/springframework/jdbc/core/StatementCreatorUtils.java with same role as CLOB!
Affects: 3.2.9, 4.0.5
Issue Links:
#20702 When using NamedParameterJdbcTemplate, NVARCHAR or NCLOB(4000 characters or less) columns are not properly populated since StatementCreatorUtils does setString for these types instead of setNString.
#13215 Can't insert into nvarchar2 using SimpleJdbcInsert whereas it works with SimpleJdbcTemplate
#16854 INSERT SELECT of large CLOB causes ORA-01461 on setString
The text was updated successfully, but these errors were encountered:
Oleksandr Gavenko opened SPR-11938 and commented
The only way to avoid LobHandler in DAO code for insert/update:
See:
another way (only for JdbcTemplate, not for NamedParameterJdbcTemplate):
java.sql.Types has NCLOB constans for Java 6/7/8:
If I do:
paramSource.addValue("clob", "a long long text", Types.CLOB);
all work fine, but with:
paramSource.addValue("clob", "a long long text", Types.NCLOB);
I get:
Actual type of table column is NCLOB, and with Type.CLOB code work fine.
My suggestion just add NCLOB to
src/main/java/org/springframework/jdbc/core/StatementCreatorUtils.java
with same role as CLOB!Affects: 3.2.9, 4.0.5
Issue Links:
The text was updated successfully, but these errors were encountered: