public class BatchingStatementWrapper extends GroovyObjectSupport implements AutoCloseable
| Modifier and Type | Field and Description | 
|---|---|
protected int | 
batchCount  | 
protected int | 
batchSize  | 
protected Logger | 
log  | 
protected List<Integer> | 
results  | 
| Constructor and Description | 
|---|
BatchingStatementWrapper(Statement delegate,
                        int batchSize,
                        Logger log)  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addBatch(String sql)  | 
void | 
clearBatch()  | 
void | 
close()  | 
int[] | 
executeBatch()  | 
protected void | 
incrementBatchCount()
Increments batch count (after addBatch(..) has been called)
 and execute  
delegate.executeBatch() if batchSize has been reached. | 
Object | 
invokeMethod(String name,
            Object args)
Invokes the given method. 
 | 
protected void | 
processResult(int[] lastResult)  | 
protected void | 
reset()  | 
getMetaClass, setMetaClassclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetProperty, setPropertyprotected int batchSize
protected int batchCount
protected Logger log
protected void reset()
public Object invokeMethod(String name, Object args)
GroovyObjectinvokeMethod in interface GroovyObjectname - the name of the method to callargs - the arguments to use for the method callpublic void addBatch(String sql) throws SQLException
SQLExceptionprotected void incrementBatchCount()
                            throws SQLException
delegate.executeBatch() if batchSize has been reached.SQLExceptionpublic void clearBatch()
                throws SQLException
SQLExceptionpublic int[] executeBatch()
                   throws SQLException
SQLExceptionprotected void processResult(int[] lastResult)
public void close()
           throws SQLException
close in interface AutoCloseableSQLException