Skip to content

Latest commit

 

History

History
57 lines (42 loc) · 2.26 KB

File metadata and controls

57 lines (42 loc) · 2.26 KB
title getBinaryStream Method (int) | 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.getBinaryStream (int)
apilocation
sqljdbc.jar
apitype Assembly
ms.assetid de22a6c4-1ba3-4ed0-91a2-bf235c2ceec3
author David-Engel
ms.author v-daenge

getBinaryStream Method (int)

[!INCLUDEDriver_JDBC_Download]

Retrieves the value of the designated column index in the current row of this SQLServerResultSet object as a binary stream of uninterpreted bytes.

Syntax

  
public java.io.InputStream getBinaryStream(int columnIndex)  

Parameters

columnIndex

An int that indicates the column index.

Return Value

An InputStream object.

Exceptions

SQLServerException

Remarks

This getBinaryStream method is specified by the getBinaryStream method in the java.sql.ResultSet interface.

This method can be used only with [!INCLUDEssNoVersion] data types of binary, varbinary, varbinary(max), and image. Trying to use it with other data types will cause an exception to be thrown.

After this method gets the value as a stream, the value can then be read in chunks from the stream. This method is particularly suitable for retrieving large LONGVARBINARY values.

Note

All the data in the returned stream must be read before getting the value of any other column. The next call to a getter method implicitly closes the stream. Also, a stream can return 0 when the method InputStream.available is called, whether there is data available or not.

See Also

getBinaryStream Method (SQLServerResultSet)
SQLServerResultSet Members
SQLServerResultSet Class