Here you can find the source of NVL(Object obj, String defaultVaue)
public static String NVL(Object obj, String defaultVaue)
//package com.java2s; public class Main { public static String NVL(Object obj) { if (obj != null) return obj.toString(); else//from ww w. ja v a 2 s.c om return ""; } public static String NVL(Object obj, String defaultVaue) { if (obj != null) return obj.toString(); else return defaultVaue; } public static int NVL(Object obj, int defaultVaue) { if (obj != null) { try { return Integer.parseInt(obj.toString()); } catch (NumberFormatException e) { return defaultVaue; } } else return defaultVaue; } public static double NVL(Object obj, double defaultVaue) { if (obj != null) { try { return Double.parseDouble(obj.toString()); } catch (NumberFormatException e) { return defaultVaue; } } else return defaultVaue; } }