Available in versions: Dev (3.20) | Latest (3.19) | 3.18 | 3.17 | 3.16 | 3.15 | 3.14 | 3.13 | 3.12 | 3.11 | 3.10

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.

References to this page

Feedback

Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo