--- title: "setAsciiStream Method (int, java.io.InputStream, long) | Microsoft Docs" ms.custom: "" ms.date: "01/19/2017" ms.prod: sql ms.prod_service: connectivity ms.reviewer: "" ms.technology: connectivity ms.topic: conceptual ms.assetid: 9dfa7781-d72f-407a-a8d4-1c78c9446d09 author: David-Engel ms.author: v-daenge --- # setAsciiStream Method (int, java.io.InputStream, long) [!INCLUDE[Driver_JDBC_Download](../../../includes/driver_jdbc_download.md)] Sets the designated parameter number to the specified java.io.InputStream object with the specified number of bytes. ## Syntax ``` public final void setAsciiStream(int parameterIndex, java.io.InputStream x, long length) ``` #### Parameters *parameterIndex* An **int** that indicates the parameter number. *x* A java.io.InputStream object. *length* A **long** that indicates the number of bytes. ## Exceptions [SQLServerException](../../../connect/jdbc/reference/sqlserverexception-class.md) ## Remarks This setAsciiStream method is specified by the setAsciiStream method in the java.sql.PreparedStatement 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 [setAsciiStream Method (int, java.io.InputStream)](../../../connect/jdbc/reference/setasciistream-method-int-java-io-inputstream.md) when the application wants to update the column from a stream whose length is unknown. ## See Also [setAsciiStream Method (SQLServerPreparedStatement)](../../../connect/jdbc/reference/setasciistream-method-sqlserverpreparedstatement.md) [SQLServerPreparedStatement Members](../../../connect/jdbc/reference/sqlserverpreparedstatement-members.md)