Skip to content

ResultRset get<Number> throws NullPointerException if the cell is empty #13

@GoogleCodeExporter

Description

@GoogleCodeExporter
Any empty cell  withResultSet.get<Number> methods (e.g. getInt(), getFloat(), 
...).

In JDBC with real database return zero value not throwing NullPointerException 
or return null value.

It seems it can be fixed by simplely check "cell.doubleValue == null" in 
get<Number> methods like this:

return (<type>) ((cell == null) ? 0.0D : cell.doubleValue.doubleValue());
  --> 
return (<type>) ((cell == null || cell.doubleValue == null) ? 0.0D : 
cell.doubleValue.doubleValue());

Original issue reported on code.google.com by dennisl...@gmail.com on 23 Jul 2014 at 11:26

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions