Search code examples
javaoracle-databasespring-bootjooqoracle19c

JOOQ With Oracle19c: DSL Correct Oracle Version


I am using JOOQ With Oracle 19. In running a Simple query with DSLContext, Should I use Oracle or Oracle18C? Both of them seem to work, just curious

 DSLContext create = DSL.using(conn, SQLDialect.ORACLE);

enter image description here


Solution

  • The SQLDialect class models two things in one:

    Dialect families

    SQLDialect.ORACLE is the dialect family for the Oracle Database. It is very distinct from e.g. the SQLDialect.MYSQL dialect family.

    It can also be used as a SQL dialect, in case of which it always corresponds to the latest currently supported SQL dialect. In case of jOOQ 3.15, that would be SQLDialect.ORACLE21C, so the behaviour of ORACLE and ORACLE21C is the same.

    As soon as a hypothetical Oracle 23c is released, and jOOQ once jOOQ supports it, the family ORACLE will correspond to the dialect ORACLE23C.

    Dialects

    The versioned SQL dialects in jOOQ correspond to their respective Oracle Database versions. For best results on Oracle 19c, use SQLDialect.ORACLE18C. No ORACLE19C dialect has been added, as jOOQ didn't yet add any 19c specific feature support.

    This dialect will continue to work on Oracle 18c (and 19c) as it is the one used to integration test jOOQ on these Oracle versions. Even if Oracle decides to support the standard SQL BOOLEAN type in 23c, for example (one can hope), then SQLDialect.ORACLE18C will continue to emulate the type, whereas a new SQLDialect.ORACLE23C (and the SQLDialect.ORACLE dialect family) will generate boolean value expressions.