New versions: Dev (3.14) | Latest (3.13) | 3.12 | 3.11 | 3.10 | 3.9 | 3.8 | Old versions: 3.7 | 3.6 | 3.5 | 3.4 | 3.3

BOOLEAN data type

Applies to ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

The SQL standard and some databases support a BOOLEAN data type with values TRUE, FALSE, and NULL. All databases support this data type in the form of an org.jooq.Condition, a condition or predicate that can be placed in the WHERE clause, among many other places. But true SQL BOOLEAN data type support means that the data type can be used everywhere a column expression can be used, including the WHERE clause.

If the BOOLEAN data type is not natively supported, JDBC and most databases translate it to 1 or '1' (TRUE), 0 or '0' (FALSE), and NULL by convention, although other translations may be possible, including 'Y' / 'N', 'T' / 'F', 'TRUE' / 'FALSE', and many more.

jOOQ, by default, follows the most popular convention and translates to 1/0.

See the manual's section about BOOLEAN columns for details on how to use the BOOLEAN data type as a conditional expression.

The jOOQ Logo