SQLException exception = new SQLException("xx", "xxx", 28);
mockConn.setError(exception);
SQLException stmtErrror = null;
try {
stmt.clearBatch();
} catch (SQLException ex) {
stmtErrror = ex;
}
Assert.assertNotNull(stmtErrror);
Assert.assertSame(exception, stmtErrror);