Java SQL ResultSet Short Read getShortOrNull(ResultSet rs, String column)

Here you can find the source of getShortOrNull(ResultSet rs, String column)

Description

get Short Or Null

License

Apache License

Declaration

public static Short getShortOrNull(ResultSet rs, String column) throws SQLException 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.sql.ResultSet;
import java.sql.SQLException;

public class Main {
    public static Short getShortOrNull(ResultSet rs, String column) throws SQLException {
        short sVal = rs.getShort(column);
        if (rs.wasNull()) {
            return null;
        }//from   w w  w  .j a  v  a 2s  .  c o  m
        return new Short(sVal);
    }
}

Related

  1. getShort(ResultSet res, String name)
  2. getShort(ResultSet resultSet, int columnIndex)
  3. getShort(ResultSet resultSet, String columnName)
  4. getShort(ResultSet rs, String column)
  5. getShortList(ResultSet resultSet, String columnName)
  6. getShortValue(ResultSet resultSet, int columnIndex)