All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pugwoo.dbhelper.impl.part.P6_ExecuteOp Maven / Gradle / Ivy

There is a newer version: 1.6.8
Show newest version
package com.pugwoo.dbhelper.impl.part;

import java.util.HashMap;
import java.util.Map;

public class P6_ExecuteOp extends P5_DeleteOp {

    @Override
    public int executeRaw(String sql, Object... args) {
        return namedJdbcExecuteUpdate(sql, args);
    }

    @Override
    public int executeRaw(String sql, Map paramMap) {
        sql = addComment(sql);
        log(sql, 0, paramMap);
        long start = System.currentTimeMillis();

        int rows;
        if (paramMap == null) {
            rows = namedParameterJdbcTemplate.update(sql, new HashMap<>());
        } else {
            rows = namedParameterJdbcTemplate.update(sql, paramMap);
        }

        long cost = System.currentTimeMillis() - start;
        logSlow(cost, sql, 0, paramMap);
        return rows;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy