get Long from ResultSet - Java JDBC

Java examples for JDBC:ResultSet

Description

get Long from ResultSet

Demo Code


//package com.java2s;
import java.sql.ResultSet;
import java.sql.SQLException;

public class Main {
    static public Long getLong(ResultSet rs, String strColName)
            throws SQLException {
        long nValue = rs.getLong(strColName);
        if (rs.wasNull())
            return null;
        return new Long(nValue);
    }//from  w  w w.  ja v  a2 s.  co m
}

Related Tutorials