Return a double from the given object Handles the different cases from the various DBMSs @param obj @return
(Object obj)
| 92 | * @return |
| 93 | */ |
| 94 | public static Double getDouble(Object obj) { |
| 95 | if (obj == null) { |
| 96 | return (null); |
| 97 | } |
| 98 | |
| 99 | if (obj instanceof Double) { |
| 100 | return (Double) obj; |
| 101 | } else if (obj instanceof Float) { |
| 102 | return ((Float) obj).doubleValue(); |
| 103 | } else if (obj instanceof BigDecimal) { |
| 104 | return ((BigDecimal) obj).doubleValue(); |
| 105 | } |
| 106 | |
| 107 | LOG.warn("BAD BAD BAD: returning null because getDouble does not support {}", obj.getClass()); |
| 108 | |
| 109 | return (null); |
| 110 | } |
| 111 | |
| 112 | public static String clobToString(Object obj) { |
| 113 | try { |
no test coverage detected