List of utility methods to do SQL ResultSet Int Read
Integer | getInteger(ResultSet rs, String columnName) get an Integer object from a result set column with given name int value = rs.getInt(columnName); if (rs.wasNull()) { return null; return value; |
Integer | getInteger(ResultSet rs, String strColName) This method will return a null rather than zero if the database has a null value for the column. int nValue = rs.getInt(strColName); return rs.wasNull() ? null : nValue; |
Integer | getInteger(ResultSet s, int idx) Get the Integer result in slot 'idx' of ResultSet 's', being careful to return null when it's NULL. if (s.getString(idx) == null) { return null; } else { return s.getInt(idx); |
Integer | getIntegerFromResultSet(ResultSet rs, String db_name) get Integer From Result Set int n = rs.getInt(db_name); return rs.wasNull() ? null : Integer.valueOf(n); |
List | getIntegerList(ResultSet resultSet, String columnName) Returns a list of integer values using a given SQL result set and column name. List<Integer> values = null; if (resultSet != null && columnName != null) { values = new ArrayList<Integer>(); while (resultSet.next()) { values.add(getInteger(resultSet, columnName)); return values; ... |
Integer | getIntegerNotZeroNotMinValue(ResultSet rs, String columnLabel) get Integer Not Zero Not Min Value return nullIfZeroOrMinValue(getInteger(rs, columnLabel));
|
List | getIntegers(ResultSet rs, String column) get Integers Object array = rs.getArray(column).getArray(); if (array instanceof Integer[]) return asList((Integer[]) array); else if (array instanceof Number[]) return Stream.of((Number[]) array).map(Number::intValue).collect(toList()); else throw new IllegalArgumentException("Incompatible type with Integer[]: " + array.getClass()); |
Integer | getIntegerValue(ResultSet resultSet, String columnName) Return any integer value. int value = resultSet.getInt(columnName); if (resultSet.wasNull()) { return null; return Integer.valueOf(value); |
Integer | getIntegerValue(ResultSet rs, int columnIndex) Retrieves the value of the designated column in the current row of this ResultSet object as an Integer in the Java programming language.
return rs.getObject(columnIndex) == null ? null : rs.getInt(columnIndex);
|
Integer | getIntFromResultSet(ResultSet rs, String field) get Int From Result Set Integer result = null; try { Object value = rs.getObject(field); if (value != null) { result = (Integer) value; } catch (Exception e) { return result; |