public class BatchingStatementWrapper extends groovy.lang.GroovyObjectSupport implements AutoCloseable
Class which delegates to a Statement but keeps track of a batch count size. If the batch count reaches the predefined number, this Statement does an executeBatch() automatically. If batchSize is zero, then no batching is performed.
| Constructor and description |
|---|
BatchingStatementWrapper
(Statement delegate, int batchSize, Logger log) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public void |
addBatch(String sql) |
|
public void |
clearBatch() |
|
public void |
close() |
|
public int[] |
executeBatch() |
|
protected void |
incrementBatchCount()Increments batch count (after addBatch(..) has been called) and execute delegate.executeBatch() if batchSize has been reached. |
|
public Object |
invokeMethod(String name, Object args) |
|
protected void |
processResult(int[] lastResult) |
|
protected void |
reset() |
| Methods inherited from class | Name |
|---|---|
class groovy.lang.GroovyObjectSupport |
groovy.lang.GroovyObjectSupport#setMetaClass(groovy.lang.MetaClass), groovy.lang.GroovyObjectSupport#getMetaClass(), groovy.lang.GroovyObjectSupport#wait(long), groovy.lang.GroovyObjectSupport#wait(long, int), groovy.lang.GroovyObjectSupport#wait(), groovy.lang.GroovyObjectSupport#equals(java.lang.Object), groovy.lang.GroovyObjectSupport#toString(), groovy.lang.GroovyObjectSupport#hashCode(), groovy.lang.GroovyObjectSupport#getClass(), groovy.lang.GroovyObjectSupport#notify(), groovy.lang.GroovyObjectSupport#notifyAll(), groovy.lang.GroovyObjectSupport#getProperty(java.lang.String), groovy.lang.GroovyObjectSupport#setProperty(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#invokeMethod(java.lang.String, java.lang.Object) |
Increments batch count (after addBatch(..) has been called)
and execute delegate.executeBatch() if batchSize has been reached.
Copyright © 2003-2021 The Apache Software Foundation. All rights reserved.