Here you can find the source of getDoubleNotZero(ResultSet rs, String columnLabel)
public static Double getDoubleNotZero(ResultSet rs, String columnLabel) throws SQLException
//package com.java2s; //License from project: Apache License import java.sql.ResultSet; import java.sql.SQLException; public class Main { public static Double getDoubleNotZero(ResultSet rs, String columnLabel) throws SQLException { return nullIfZero(getDouble(rs, columnLabel)); }/*from ww w . java 2 s.c om*/ public static Long nullIfZero(Long number) { if (number == null || number == 0) { return null; } else { return number; } } public static Double nullIfZero(Double number) { if (number == null || number == 0) { return null; } else { return number; } } public static Double getDouble(ResultSet rs, String columnLabel) throws SQLException { double value = rs.getDouble(columnLabel); if (rs.wasNull()) { return null; } else { return value; } } }