Top Description Methods
org.jooq

public Interface Batch

extends Serializable, Publisher<Integer>
Known Direct Subinterfaces
org.jooq.BatchBindStep
Known Direct Implementers
org.jooq.impl.AbstractBatch
Imports
java.io.Serializable, java.sql.Statement, java.util.concurrent.CompletionStage, .Executor, org.jooq.exception.DataAccessException, org.jetbrains.annotations.Blocking, .NotNull

A wrapper for a JDBC batch operation. It has two modes:

  1. Execute several queries without bind values
    
    create.batch(query1,
                 query2,
                 query3)
          .execute();
    
  2. Execute one query several times with bind values
    
    create.batch(query)
          .bind(valueA1, valueA2)
          .bind(valueB1, valueB2)
          .execute();
    
Author
Lukas Eder
See Also
Statement#executeBatch()

Method Summary

Modifier and TypeMethod and Description
public @NotNull int[]
execute()

Execute the batch operation.

public @NotNull CompletionStage<int[]>
executeAsync()

Execute the batch operation in a new CompletionStage.

public @NotNull CompletionStage<int[]>
executeAsync(Executor executor)

Execute the query in a new CompletionStage that is asynchronously completed by a task running in the given executor.

public int
size()

Get the number of executed queries in this batch operation

Inherited from org.jooq.Publisher:
subscribe

Method Detail

executeback to summary
public @NotNull int[] execute() throws DataAccessException

Execute the batch operation.

Annotations
@Blocking
Exceptions
DataAccessException:
if something went wrong executing the query
See Also
Statement#executeBatch()
executeAsyncback to summary
public @NotNull CompletionStage<int[]> executeAsync()

Execute the batch operation in a new CompletionStage.

The result is asynchronously completed by a task running in an Executor provided by the underlying Configuration#executorProvider().

Annotations
@NotNull
See Also
Statement#executeBatch()
executeAsyncback to summary
public @NotNull CompletionStage<int[]> executeAsync(Executor executor)

Execute the query in a new CompletionStage that is asynchronously completed by a task running in the given executor.

Annotations
@NotNull
sizeback to summary
public int size()

Get the number of executed queries in this batch operation