All versions: 3.11 | 3.10 | 3.9 | 3.8 | 3.7 | 3.6 | 3.5 | 3.4 | 3.3 | Development versions: 3.12

The below JSON data represents two author records that may have been exported previously, by jOOQ's exporting functionality:

{"fields" :[{"name":"ID","type":"INTEGER"},
            {"name":"AUTHOR_ID","type":"INTEGER"},
            {"name":"TITLE","type":"VARCHAR"}],
 "records":[[1,1,"1984"],
            [2,1,"Animal Farm"]]}

With jOOQ, you can load this data using various parameters from the loader API. A simple load may look like this:

DSLContext create = DSL.using(connection, dialect);

// Load data into the BOOK table from an input stream
// holding the JSON data.
create.loadInto(BOOK)
      .loadJSON(inputstream, encoding)
      .fields(BOOK.ID, BOOK.AUTHOR_ID, BOOK.TITLE)
      .execute();

No other, JSON-specific options are currently available. For additional Loader API options, please refer to the manual's section about importing CSV.

The jOOQ Logo