Java SQL ResultSet Long Read getLongOrNull(ResultSet rs, String column)

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

Description

get Long Or Null

License

Apache License

Declaration

public static Long getLongOrNull(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 Long getLongOrNull(ResultSet rs, String column) throws SQLException {
        long lVal = rs.getLong(column);
        if (rs.wasNull()) {
            return null;
        }//from w  ww  .  ja  va  2 s  .  c  o  m
        return new Long(lVal);
    }
}

Related

  1. getLong(ResultSet rs, String columnName)
  2. getLongDateFromResultSet(ResultSet rset, Enum field)
  3. getLongFromResultSet(ResultSet rs, String db_name)
  4. getLongFromResultSet(ResultSet rs, String field)
  5. getLongList(ResultSet resultSet, String columnName)
  6. getLongString(ResultSet rs, int pos)
  7. getLongValue(ResultSet resultSet, int columnIndex)
  8. getLongValue(ResultSet rs, int valueIndex)
  9. readLongFromResultSet(ResultSet rs, String column)