Example usage for org.springframework.jdbc.core.namedparam NamedParameterJdbcOperations update

List of usage examples for org.springframework.jdbc.core.namedparam NamedParameterJdbcOperations update

Introduction

In this page you can find the example usage for org.springframework.jdbc.core.namedparam NamedParameterJdbcOperations update.

Prototype

int update(String sql, Map<String, ?> paramMap) throws DataAccessException;

Source Link

Document

Issue an update via a prepared statement, binding the given arguments.

Usage

From source file:org.geoserver.jdbcconfig.internal.DbMappings.java

private void createType(Class<? extends Info> clazz, NamedParameterJdbcOperations template) {

    final String typeName = clazz.getName();
    String sql = "insert into type (typename) values (:typeName)";
    int update = template.update(sql, params("typeName", typeName));
    if (1 == update) {
        log("created type " + typeName);
    }//from   w ww . j a v  a  2  s  .  c  o  m
}