Package org.eclipse.net4j.db
Class StatementBatcher
java.lang.Object
org.eclipse.net4j.util.event.Notifier
org.eclipse.net4j.db.StatementBatcher
- All Implemented Interfaces:
AutoCloseable,Consumer<String>,org.eclipse.net4j.util.event.INotifier,org.eclipse.net4j.util.event.INotifier.INotifier2
public class StatementBatcher
extends org.eclipse.net4j.util.event.Notifier
implements AutoCloseable, Consumer<String>
A helper for batching SQL statements.
- Since:
- 4.13
- Author:
- Eike Stepper
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final classstatic final classNested classes/interfaces inherited from class org.eclipse.net4j.util.event.Notifier
org.eclipse.net4j.util.event.Notifier.CancelationNested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier
org.eclipse.net4j.util.event.INotifier.INotifier2 -
Constructor Summary
ConstructorsConstructorDescriptionStatementBatcher(Connection connection) StatementBatcher(Connection connection, int batchSize) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidintvoidclose()protected final intprotected final Statementfinal intfinal intfinal Connectionfinal Statementfinal intfinal booleanisClosed()Methods inherited from class org.eclipse.net4j.util.event.Notifier
addListener, addUniqueListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListener, hasListeners, lastListenerRemoved, listenerAdded, listenerRemoved, removeListener
-
Constructor Details
-
StatementBatcher
-
StatementBatcher
-
-
Method Details
-
getConnection
-
getStatement
-
getBatchSize
public final int getBatchSize() -
getBatchCount
public final int getBatchCount() -
getTotalUpdateCount
public final int getTotalUpdateCount() -
accept
-
batch
-
isClosed
public final boolean isClosed() -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
ensureStatement
- Throws:
SQLException
-
doExecuteBatch
protected final int doExecuteBatch()
-