resultset doesn't recognize null value in boolean

I have LO 5.3.6.1 hooked up to MySQL through Java Connector version 5.1.44 (on Windows 10), and I have a macro that assigns to a variable dim’ed as a boolean the value pulled from a query’s resultset using resultset.getBoolean(#). Unfortunately, if the value returned by the query should be Null, the boolean variable is set to false, not null. Is this behavior expected?

I can think of two reasons for this behavior that would make sense to me. The .getBoolean() is not equipped to handle null values or the boolean type in LO basic is not equipped to handle a null value.

It would seem that the problem is in the .getBoolean().

https://docs.oracle.com/javase/7/docs/api/java/sql/ResultSet.html#wasNull()

Unfortunately, I’m not clever enough to use the wasNull() to determine whether the boolean was null in the query result. I’m in luck because the boolean is already the last column of my query. In an If statement, I’ve tried “(mQueryResult.wasNull())”, “wasNull(mQueryResult)”, and “mQueryResult wasNull()”, “(mQueryResult.wasNull(2)” (Column 2 is the boolean that should be returning Null.), but none of these returns a value of true for the if statement. From what I’ve read, the first one should, but it’s definitely not.

I’ve learned why I was having trouble using the .wasNull(). If I moved it to after the .getboolean() call, it worked. But as dumb as it sounds, when I tried to set my boolean variable in the macro to Null, I get an error “Inadmissible value or data type.
Data type mismatch.”

My method for setting it to Null was
“bAccepted = Null”

The problem was both the output of .getBoolean() and the boolean type in LO basic. By using the .wasNull method of the resultset type as I described in the comment above, and employing another boolean variable to indicate whether the query result from the boolean column was null, I was able to accomplish what I wanted.