Loader API is used for configuring data loads.
Add options to for the loading behaviour. For performance reasons, you can fine-tune three different types of measures:
INSERT
statement.
XYZ*Step types directly from client code
It is usually not recommended to reference any XYZ*Step types
directly from client code, or assign them to local variables. When writing
dynamic SQL, creating a statement's components dynamically, and passing them
to the DSL API statically is usually a better choice. See the manual's
section about dynamic SQL for details: https://www.jooq.org/doc/latest/manual/sql-building/dynamic-sql.
Drawbacks of referencing the XYZ*Step types directly:
| Modifier and Type | Method and Description |
|---|---|
| public @NotNull LoaderOptionsStep | batchAfter(int
The number of records that are batched together. number)Batch a given number of bulk statements together. |
| public @NotNull LoaderOptionsStep | |
| public @NotNull LoaderOptionsStep | |
| public @NotNull LoaderOptionsStep | bulkAfter(int
The number of records that are put together in one bulk
statement. number)Bulk-insert a given number of statements in a single multi-row bulk statement. |
| public @NotNull LoaderOptionsStep | |
| public @NotNull LoaderOptionsStep | |
| public @NotNull LoaderOptionsStep | commitAfter(int
The number of records that are committed together. number)Commit after a certain number of batches. |
| public @NotNull LoaderOptionsStep | |
| public @NotNull LoaderOptionsStep | |
| public @NotNull LoaderOptionsStep | |
| public @NotNull LoaderOptionsStep | onDuplicateKeyError()
Instruct the |
| public @NotNull LoaderOptionsStep | onDuplicateKeyIgnore()
Instruct the |
| public @NotNull LoaderOptionsStep | onDuplicateKeyUpdate()
Instruct the |
| public @NotNull LoaderOptionsStep | onErrorAbort()
Instruct the |
| public @NotNull LoaderOptionsStep |
| batchAfter | back to summary |
|---|---|
| public @NotNull LoaderOptionsStep Batch a given number of bulk statements together.
| |
| batchAll | back to summary |
|---|---|
| public @NotNull LoaderOptionsStep Batch all bulk statements in one JDBC batch statement.
If
| |
| batchNone | back to summary |
|---|---|
| public @NotNull LoaderOptionsStep Do not batch bulk statements together. If you don't specify a BATCH OPTION, this will be the default.
| |
| bulkAfter | back to summary |
|---|---|
| public @NotNull LoaderOptionsStep Bulk-insert a given number of statements in a single multi-row bulk statement.
If
| |
| bulkAll | back to summary |
|---|---|
| public @NotNull LoaderOptionsStep Bulk-insert all rows in a single multi-row bulk statement.
If
| |
| bulkNone | back to summary |
|---|---|
| public @NotNull LoaderOptionsStep Do not bulk-insert rows in multi-row bulk statements. If you don't specify a BULK OPTION, this will be the default.
| |
| commitAfter | back to summary |
|---|---|
| public @NotNull LoaderOptionsStep Commit after a certain number of batches.
With this clause, errors will never result in a rollback, even when you
specify
The COMMIT OPTIONS might be useful for fine-tuning performance behaviour
in some RDBMS, where large commits lead to a high level of concurrency in
the database. Use this on fresh transactions only. Commits/Rollbacks are
executed directly upon the connection returned by
If you don't specify a COMMIT OPTION,
| |
| commitAll | back to summary |
|---|---|
| public @NotNull LoaderOptionsStep Commit only after inserting all batches. If this is used together with
The COMMIT OPTIONS might be useful for fine-tuning performance behaviour
in some RDBMS, where large commits lead to a high level of concurrency in
the database. Use this on fresh transactions only. Commits/Rollbacks are
executed directly upon the connection returned by
If you don't specify a COMMIT OPTION,
| |
| commitEach | back to summary |
|---|---|
| public @NotNull LoaderOptionsStep Commit each batch.
This is the same as calling
With this clause, errors will never result in a rollback, even when you
specify
The COMMIT OPTIONS might be useful for fine-tuning performance behaviour
in some RDBMS, where large commits lead to a high level of concurrency in
the database. Use this on fresh transactions only. Commits/Rollbacks are
executed directly upon the connection returned by
If you don't specify a COMMIT OPTION,
| |
| commitNone | back to summary |
|---|---|
| public @NotNull LoaderOptionsStep Leave committing / rollbacking up to client code. The COMMIT OPTIONS might be useful for fine-tuning performance behaviour in some RDBMS, where large commits lead to a high level of concurrency in the database.
If you don't specify a COMMIT OPTION, this will be the default, leaving
transaction handling up to you. This should be your choice, when you use
container-managed transactions, too, or your
| |
| onDuplicateKeyError | back to summary |
|---|---|
| public @NotNull LoaderOptionsStep Instruct the
If this is combined with
If you don't specify a behaviour, this will be the default. This cannot
be combined with
| |
| onDuplicateKeyIgnore | back to summary |
|---|---|
| public @NotNull LoaderOptionsStep Instruct the
If the loaded table does not have any unique keys, then all records are
inserted. This may influence the JDBC driver's outcome on
If you don't specify a behaviour,
| |
| onDuplicateKeyUpdate | back to summary |
|---|---|
| public @NotNull LoaderOptionsStep Instruct the
If the loaded table does not have any unqiue keys, then all records are
inserted and this clause behaves like
If you don't specify a behaviour, | |
| onErrorAbort | back to summary |
|---|---|
| public @NotNull LoaderOptionsStep Instruct the
If this is combined with
If you don't specify a behaviour, this will be the default. This cannot
be combined with
| |
| onErrorIgnore | back to summary |
|---|---|
| public @NotNull LoaderOptionsStep Instruct the
If you don't specify a behaviour,
| |