Java Utililty Methods SQL ResultSet Short Read

List of utility methods to do SQL ResultSet Short Read

Description

The list of methods to do SQL ResultSet Short Read are organized into topic(s).

Method

ShortgetShort(ResultSet res, String name)
Returns the values of the specified column as a Short.
short v = res.getShort(name);
return res.wasNull() ? null : v;
ShortgetShort(ResultSet resultSet, int columnIndex)
get Short
short value = resultSet.getShort(columnIndex);
return resultSet.wasNull() ? null : value;
ShortgetShort(ResultSet resultSet, String columnName)
Returns a short value using a given SQL result set and column name.
Short value = null;
if (resultSet != null && columnName != null) {
    short columnValue = resultSet.getShort(columnName);
    if (!resultSet.wasNull()) {
        value = new Short(columnValue);
return value;
...
shortgetShort(ResultSet rs, String column)
get a short from ResultSet rs with name 'column'
short i = rs.getShort(column);
if (rs.wasNull())
    i = 0;
return i;
ListgetShortList(ResultSet resultSet, String columnName)
Returns a list of short values using a given SQL result set and column name.
List<Short> values = null;
if (resultSet != null && columnName != null) {
    values = new ArrayList<Short>();
    while (resultSet.next()) {
        values.add(getShort(resultSet, columnName));
return values;
...
ShortgetShortOrNull(ResultSet rs, String column)
get Short Or Null
short sVal = rs.getShort(column);
if (rs.wasNull()) {
    return null;
return new Short(sVal);
ShortgetShortValue(ResultSet resultSet, int columnIndex)
Return any short value.
short value = resultSet.getShort(columnIndex);
if (resultSet.wasNull()) {
    return null;
return Short.valueOf(value);