-
Notifications
You must be signed in to change notification settings - Fork 7
Null and primitive values
firegloves edited this page Jul 20, 2022
·
1 revision
Apache POI receives primitive data type in its Cell.setCellValue
when dealing with numbers and booleans, so passing a null value read from the DB to the cell will result in the primitive default value (0.0 for double, false for boolean and so on).
MemPOI v1.5 introduces the possibility to keep null
values when read from DB, by setting the property nullValuesOverPrimitiveDetaultOnes
of the MemPOI object to true
.
In this case, cells that read a null
value from the DB will be blank:
MempoiBuilder.aMemPOI()
.addMempoiSheet(new MempoiSheet(prepStmt))
.withNullValuesOverPrimitiveDetaultOnes(true)
.build();