Пример #1
0
  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;
  }
Пример #2
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;
 }