Skip to content

Commit 9fdfeba

Browse files
committed
optimize code
1 parent 2c1aced commit 9fdfeba

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

core/src/main/java/com/robin/core/base/dao/SimpleJdbcDao.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,16 @@ public static int executeOperationWithQuery(final Connection conn, String sql, b
420420
}
421421
return qRunner.query(conn, sql, extractor::extractData);
422422
}
423+
public static int executeOperationWithHandler(final Connection conn, String sql, boolean pmdKnownBroken, final ResultSetHandler<Integer> handler) throws SQLException {
424+
QueryRunner qRunner ;
425+
if (pmdKnownBroken) {
426+
qRunner = new QueryRunner(pmdKnownBroken);
427+
} else {
428+
qRunner = new QueryRunner();
429+
}
430+
return qRunner.query(conn, sql, handler);
431+
}
432+
423433

424434
public static int executeOperationWithQuery(final Connection conn, String sql, Object[] param, boolean pmdKnownBroken, final ResultSetOperationExtractor extractor) throws SQLException {
425435
QueryRunner qRunner = new QueryRunner(pmdKnownBroken);

0 commit comments

Comments
 (0)