@Override public Circle mapRow(ResultSet resultSet, int rowNum) throws SQLException { Circle circle = new Circle(); circle.setId(resultSet.getInt("ID")); circle.setName(resultSet.getString("NAME")); return circle; }
public void insertCircle(Circle circle) { String sql = "INSERT INTO CIRCLE (ID, NAME) VALUES (:id, :name)"; SqlParameterSource namedParameters = new MapSqlParameterSource("id", circle.getId()).addValue("name", circle.getName()); namedParameterJdbcTemplate.update(sql, namedParameters); }