Skip to content

Latest commit

 

History

History
55 lines (38 loc) · 2.09 KB

File metadata and controls

55 lines (38 loc) · 2.09 KB
title setBinaryStream Method (int, java.io.InputStream, int)
description setBinaryStream Method (int, java.io.InputStream, int)
author David-Engel
ms.author davidengel
ms.date 01/19/2017
ms.service sql
ms.subservice connectivity
ms.topic reference
apilocation sqljdbc.jar
apiname SQLServerPreparedStatement.setBinaryStream
apitype Assembly

setBinaryStream Method (int, java.io.InputStream, int)

[!INCLUDEDriver_JDBC_Download]

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

Syntax

  
public final void setBinaryStream(int n,  
                                  java.io.InputStream x,  
                                  int length)  

Parameters

n

An int that indicates the parameter number.

x

An InputStream object.

length

An int that indicates the number of bytes.

Exceptions

SQLServerException

Remarks

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

If the length of the stream is different from 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 (int, java.io.InputStream) when the application wants to update the column from a stream whose length is unknown.

See Also

setBinaryStream Method (SQLServerPreparedStatement)
SQLServerPreparedStatement Members