Here you can find the source of ExecUpdateSql(Connection conn, String strSql)
public static void ExecUpdateSql(Connection conn, String strSql) throws Exception
//package com.java2s; //License from project: Open Source License import java.sql.Connection; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; public class Main { private static final Logger logger = LogManager.getLogger(); public static void ExecUpdateSql(Connection conn, String strSql) throws Exception { java.sql.Statement stmt = conn.createStatement(); logger.info(strSql);//from w ww . j ava 2s . co m int i = stmt.executeUpdate(strSql); logger.info("rows count={}", i); if (conn.getAutoCommit() == false) { conn.commit(); } } }