public boolean insertNamedParam(Circle c) { String sql = "insert into circle (id,name) values(:id ,:name )"; SqlParameterSource sqlParameterSource = new MapSqlParameterSource("id", c.getId()).addValue("name", c.getName()); return parameterJdbcTemplate.update(sql, sqlParameterSource) > 0; }
public boolean insert(Circle c) { String sql = "insert into circle (id,name) values(? ,? )"; return jdbcTemplate.update(sql, new Object[] {c.getId(), c.getName()}) > 0; }