diff --git a/src/com/inet/excel/ExcelSheetResultSet.java b/src/com/inet/excel/ExcelSheetResultSet.java index 3015488..277dfe3 100644 --- a/src/com/inet/excel/ExcelSheetResultSet.java +++ b/src/com/inet/excel/ExcelSheetResultSet.java @@ -35,6 +35,7 @@ public class ExcelSheetResultSet extends ExcelResultSet { private List> rowBatch; private int currentRowIndex; private int currentBatchIndex; + private boolean wasNull; private boolean closed; /** Constructor of the class. @@ -56,6 +57,7 @@ public ExcelSheetResultSet( ExcelParser parser, String sheetName, int maxRowsPer this.rowCount = parser.getRowCount( sheetName ); this.currentRowIndex = -1; this.currentBatchIndex = -1; + this.wasNull = false; this.closed = false; } @@ -152,7 +154,9 @@ public boolean isClosed() throws SQLException { protected T getValue( int columnIndex ) throws SQLException { throwIfAlreadyClosedOrReachedEnd(); throwIfColumnIndexIsInvalid( columnIndex ); - return (T)rowBatch.get( currentBatchIndex ).get( columnIndex - 1 ); + T value = (T)rowBatch.get( currentBatchIndex ).get( columnIndex - 1 ); + wasNull = value == null; + return value; } /** @@ -161,6 +165,6 @@ protected T getValue( int columnIndex ) throws SQLException { @Override public boolean wasNull() throws SQLException { throwIfAlreadyClosed(); - return false; + return wasNull; } }