--- title: "getLong Method (int) (SQLServerResultSet) | Microsoft Docs" ms.custom: "" ms.date: "01/19/2017" ms.prod: sql ms.prod_service: connectivity ms.reviewer: "" ms.technology: connectivity ms.topic: conceptual apiname: - "SQLServerResultSet.getLong (int)" apilocation: - "sqljdbc.jar" apitype: "Assembly" ms.assetid: 2d1beec5-fc50-4563-81da-835e4b392874 author: David-Engel ms.author: v-daenge --- # getLong Method (int) (SQLServerResultSet) [!INCLUDE[Driver_JDBC_Download](../../../includes/driver_jdbc_download.md)] Retrieves the value of the designated column index in the current row of this [SQLServerResultSet](../../../connect/jdbc/reference/sqlserverresultset-class.md) object as a **long** in the Java programming language. ## Syntax ``` public long getLong(int columnIndex) ``` #### Parameters *columnIndex* An **int** that indicates the column index. ## Return Value A **long** value. ## Exceptions [SQLServerException](../../../connect/jdbc/reference/sqlserverexception-class.md) ## Remarks This getLong method is specified by the getLong method in the java.sql.ResultSet interface. This method is supported only on [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] data types that can safely return an integer value such as bigint, int, smallint, tinyint, and bit. Using this method on any other data types will cause an exception to be thrown. ## See Also [getLong Method (SQLServerResultSet)](../../../connect/jdbc/reference/getlong-method-sqlserverresultset.md) [SQLServerResultSet Members](../../../connect/jdbc/reference/sqlserverresultset-members.md) [SQLServerResultSet Class](../../../connect/jdbc/reference/sqlserverresultset-class.md)