How to get a field's value with ResultSet.getxxx when it is a NULL?
In general, one may retrieve one of three values for a column that is null, depending on the data type. For methods that return objects, null will be returned; for numerics ( get Byte(), getShort(), getInt(), getLong(), getFloat(), and getDouble() ) zero will be returned; for getBoolean() false will be returned. To find out if the value was actually NULL, use ResultSet.wasNull() before invoking another getXXX method. For more information, see the JDBC(tm) Technology Guide: Getting Started 5.1.19 NULL Result Values.