예제 #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;
 }