-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Description
Alexander Nesterov opened SPR-7199 and commented
SimpleJdbcInsertOperations.executeAndReturnKey() call fails if there is any SqlLobValue parameter passed as a value to SQL request.
Seems that the problem is in AbstractJdbcInsert.setParameterValues() method, which incorrectly parses parameter types, setting them all to TYPE_UNKNOWN even if types are properly specified.
To corrent the problem the following code in setParameterValues() should be modifed:
if (columnTypes == null || colIndex < columnTypes.length) {
StatementCreatorUtils.setParameterValue(preparedStatement, colIndex, SqlTypeValue.TYPE_UNKNOWN, value);
}
->
if (columnTypes == null || colIndex > columnTypes.length) {
StatementCreatorUtils.setParameterValue(preparedStatement, colIndex, SqlTypeValue.TYPE_UNKNOWN, value);
}
Affects: 3.0.2
Referenced from: commits d22a6f9