可用版本:Dev (3.21) | 最新 (3.20) | 3.19 | 3.18 | 3.17 | 3.16 | 3.15 | 3.14 | 3.13 | 3.12 | 3.11

Loader API

适用于 ✅ 开源版   ✅ 专业版   ✅ 企业版

加载器 API 的实现方式与 jOOQ 中的任何其他 DSL 语句类似,遵循以下几个步骤

create.loadInto(TARGET_TABLE)
      .[options]
      .[source and source to target mapping]
      .[listeners]
      .[execution and error handling]

例如

create.loadInto(BOOK)

      // Options
      .onDuplicateKeyError()
      .bulkAll()
      .batchAll()
      .commitAll()

      // Source and source to target mapping
      .loadCSV(inputStream)
      .fields(BOOK.ID, BOOK.AUTHOR_ID, BOOK.TITLE)

      // Listeners
      .onRow(ctx -> { /* ... */ })

      // Execution and error handling
      .execute()
      .errors()
      .forEach(e -> { /* ... */ });

有关每个步骤的详细信息,请参阅以下章节

反馈

您对此页面有任何反馈吗? 我们很乐意听取您的意见!

The jOOQ Logo