I have an issue passing a null value to NamedParameterJdbcTemplate using MapSqlParameterSource of the spring framework. Anyone knows how to do this?
Currently my code is :
String sql = "update person set project = :project where id = :id;";
MapSqlParameterSource params = new MapSqlParameterSource();
params.addValue("project ", null);
params.addValue("id ", 1);
int count = newNamedParameterJDBCTemplate().update(sql, params);
This is where I get a NullPointerException.
dataSource
forNamedParameterJDBCTemplate
that returning fromnewNamedParameterJDBCTemplate()
? – Angus