Skip to content

Latest commit

 

History

History
62 lines (45 loc) · 2.26 KB

File metadata and controls

62 lines (45 loc) · 2.26 KB
title setBinaryStream Method to input stream - long | Microsoft Docs
ms.custom
ms.date 01/19/2017
ms.prod sql
ms.prod_service drivers
ms.service
ms.component jdbc
ms.reviewer
ms.suite sql
ms.technology
drivers
ms.tgt_pltfrm
ms.topic article
ms.assetid d59c7327-c9dc-4e4f-9dff-19e1a3c62eb2
caps.latest.revision 12
author MightyPen
ms.author genemi
manager craigg

setBinaryStream Method (java.lang.String, java.io.InputStream, long)

[!INCLUDEDriver_JDBC_Download]

Sets the designated parameter to the specified input stream, which will have the specified number of bytes.

Syntax

  
public void setBinaryStream(java.lang.String parameterName,  
                            java.io.InputStream x,  
                            long length)  

Parameters

parameterName

A String that contains the name of the parameter.

x

An InputStream object.

length

A long that indicates the length in the number of bytes.

Exceptions

SQLServerException

Remarks

This setBinaryStream method is specified by the setBinaryStream method in the java.sql.CallableStatement interface.

If the length of the stream is different than what is specified in the length parameter, the JDBC driver throws an exception when the row is updated or inserted.

If the length of the stream is unknown, the length parameter may be set to -1 to indicate that the driver should accept the stream regardless of its length. With sqljdbc4.jar, we recommend that you use the JDBC 4.0 method setBinaryStream Method (java.lang.String, java.io.InputStream) when the application wants to update the column from a stream whose length is unknown.

See Also

setBinaryStream (SQLServerCallableStatement)
SQLServerCallableStatement Members