--
--
--
--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
If the designated column has a datatype of CHAR or VARCHAR and contains a "0" or has a datatype of BIT, TINYINT, SMALLINT, INTEGER or BIGINT and contains a 0, a value of false is returned. If the designated column has a datatype of CHAR or VARCHAR and contains a "1" or has a datatype of BIT, TINYINT, SMALLINT, INTEGER or BIGINT and contains a 1, a value of true is returned.
Note: BOOLEAN is the predefined enumeration type STANDARD.BOOLEAN
with values (FALSE, TRUE). The equivalences
BOOLEAN'POS(FALSE) 0
BOOLEAN'POS(TRUE) 1
define the correspondence between the bit values of 0 and 1
and the Boolean values of false and true, respectively.Taken from http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt (I didn't find any such reference in a later version of the standard, in a quick document scan).
Chosing any other encoding for boolean values in a Java / SQL application will probably just cause headaches without adding value. If your legacy database does have such encodings, you can still use jOOQ's converter feature
Cheers
Lukas
So, the bottom line is the Oracle JDBC driver does not care about specification. Trying to set a number(1,0) field with a null value as boolean throws an exception and there is not much we can do (excluding registering an issue at oracle).
As far as I remember, projects like Hibernate or Toplink Essentials (followed by Eclipselink) do translate booleans to numbers before touching JDBC, but maybe we should double check it.
Regards,
Witold Szczerba
---
Sent from my mobile phone.