Package com.microsoft.sqlserver.jdbc

## Class SQLServerPreparedStatement

- java.lang.Object
- - com.microsoft.sqlserver.jdbc.SQLServerStatement
  - - com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement

All Implemented Interfaces:
  `ISQLServerPreparedStatement`, `ISQLServerStatement`, `java.lang.AutoCloseable`, `java.sql.PreparedStatement`, `java.sql.Statement`, `java.sql.Wrapper`

Direct Known Subclasses:
  `SQLServerCallableStatement`, `SQLServerPreparedStatement42`

    public class SQLServerPreparedStatement
    extends SQLServerStatement
    implements ISQLServerPreparedStatement

SQLServerPreparedStatement provides JDBC prepared statement functionality. SQLServerPreparedStatement provides methods for the user to supply parameters as any native Java type and many Java object types.

SQLServerPreparedStatement prepares a statement using SQL Server's sp_prepexec and re-uses the returned statement handle for each subsequent execution of the statement (typically using different parameters provided by the user)

SQLServerPreparedStatement supports batching whereby a set of prepared statements are executed in a single database round trip to improve runtime performance.

The API javadoc for JDBC API methods that this class implements are not repeated here. Please see Sun's JDBC API interfaces javadoc for those details.

### Field Summary

### Fields inherited from class com.microsoft.sqlserver.jdbc.SQLServerStatement

`stmtColumnEncriptionSetting`

### Fields inherited from interface java.sql.Statement

`CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO`

### Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods
`void` `addBatch​()`
`void` `addBatch​(java.lang.String sql)`
`void` `clearBatch​()`
`void` `clearParameters​()`
`boolean` `execute​()` Execute a query or non query statement.
`boolean` `execute​(java.lang.String sql)` Execute an update or query.
`int[]` `executeBatch​()` Send a batch of statements to the database.
`long[]` `executeLargeBatch​()`
`long` `executeLargeUpdate​()`
`java.sql.ResultSet` `executeQuery​()` Execute a query.
`java.sql.ResultSet` `executeQuery​(java.lang.String sql)` Execute a result set query
`int` `executeUpdate​()`
`int` `executeUpdate​(java.lang.String sql)` Execute a JDBC update
`java.sql.ResultSetMetaData` `getMetaData​()`
`java.sql.ParameterMetaData` `getParameterMetaData​()`
`java.sql.ParameterMetaData` `getParameterMetaData​(boolean forceRefresh)` Returns parameter metadata for the prepared statement.
`int` `getPreparedStatementHandle​()` The server handle for this prepared statement.
`void` `setArray​(int i, java.sql.Array x)`
`void` `setAsciiStream​(int parameterIndex, java.io.InputStream x)`
`void` `setAsciiStream​(int n, java.io.InputStream x, int length)`
`void` `setAsciiStream​(int parameterIndex, java.io.InputStream x, long length)`
`void` `setBigDecimal​(int n, java.math.BigDecimal x)`
`void` `setBigDecimal​(int n, java.math.BigDecimal x, int precision, int scale)` Sets the designated parameter to the given `java.math.BigDecimal` value.
`void` `setBigDecimal​(int n, java.math.BigDecimal x, int precision, int scale, boolean forceEncrypt)` Sets the designated parameter to the given `java.math.BigDecimal` value.
`void` `setBinaryStream​(int parameterIndex, java.io.InputStream x)`
`void` `setBinaryStream​(int n, java.io.InputStream x, int length)`
`void` `setBinaryStream​(int parameterIndex, java.io.InputStream x, long length)`
`void` `setBlob​(int parameterIndex, java.io.InputStream inputStream)`
`void` `setBlob​(int parameterIndex, java.io.InputStream inputStream, long length)`
`void` `setBlob​(int i, java.sql.Blob x)`
`void` `setBoolean​(int n, boolean x)`
`void` `setBoolean​(int n, boolean x, boolean forceEncrypt)` Sets the designated parameter to the given Java `boolean` value.
`void` `setByte​(int n, byte x)`
`void` `setByte​(int n, byte x, boolean forceEncrypt)` Sets the designated parameter to the given Java `byte` value.
`void` `setBytes​(int n, byte[] x)`
`void` `setBytes​(int n, byte[] x, boolean forceEncrypt)` Sets the designated parameter to the given Java array of bytes.
`void` `setCharacterStream​(int parameterIndex, java.io.Reader reader)`
`void` `setCharacterStream​(int n, java.io.Reader reader, int length)`
`void` `setCharacterStream​(int parameterIndex, java.io.Reader reader, long length)`
`void` `setClob​(int parameterIndex, java.io.Reader reader)`
`void` `setClob​(int parameterIndex, java.io.Reader reader, long length)`
`void` `setClob​(int parameterIndex, java.sql.Clob clobValue)`
`void` `setDate​(int n, java.sql.Date x)`
`void` `setDate​(int n, java.sql.Date x, java.util.Calendar cal)`
`void` `setDate​(int n, java.sql.Date x, java.util.Calendar cal, boolean forceEncrypt)` Sets the designated parameter to the given `java.sql.Date` value, using the given `Calendar` object.
`void` `setDateTime​(int n, java.sql.Timestamp x)` Sets the designated parameter to the given `java.sql.Timestamp` value
`void` `setDateTime​(int n, java.sql.Timestamp x, boolean forceEncrypt)` Sets the designated parameter to the given `java.sql.Timestamp` value
`void` `setDateTimeOffset​(int n, DateTimeOffset x)` Sets the designated parameter to the given `microsoft.sql.DatetimeOffset` value
`void` `setDateTimeOffset​(int n, DateTimeOffset x, int scale)` Sets the designated parameter to the given `microsoft.sql.DatetimeOffset` value
`void` `setDateTimeOffset​(int n, DateTimeOffset x, int scale, boolean forceEncrypt)` Sets the designated parameter to the given `microsoft.sql.DatetimeOffset` value
`void` `setDouble​(int n, double x)`
`void` `setDouble​(int n, double x, boolean forceEncrypt)` Sets the designated parameter to the given Java `double` value.
`void` `setFloat​(int n, float x)`
`void` `setFloat​(int n, float x, boolean forceEncrypt)` Sets the designated parameter to the given Java `float` value.
`void` `setInt​(int n, int value)`
`void` `setInt​(int n, int value, boolean forceEncrypt)` Sets the designated parameter to the given Java `int` value.
`void` `setLong​(int n, long x)`
`void` `setLong​(int n, long x, boolean forceEncrypt)` Sets the designated parameter to the given Java `long` value.
`void` `setMoney​(int n, java.math.BigDecimal x)` Sets the designated parameter to the given `java.math.BigDecimal` value.
`void` `setMoney​(int n, java.math.BigDecimal x, boolean forceEncrypt)` Sets the designated parameter to the given `java.math.BigDecimal` value.
`void` `setNCharacterStream​(int parameterIndex, java.io.Reader value)`
`void` `setNCharacterStream​(int parameterIndex, java.io.Reader value, long length)`
`void` `setNClob​(int parameterIndex, java.io.Reader reader)`
`void` `setNClob​(int parameterIndex, java.io.Reader reader, long length)`
`void` `setNClob​(int parameterIndex, java.sql.NClob value)`
`void` `setNString​(int parameterIndex, java.lang.String value)`
`void` `setNString​(int parameterIndex, java.lang.String value, boolean forceEncrypt)` Sets the designated parameter to the given `String` object.
`void` `setNull​(int index, int jdbcType)`
`void` `setNull​(int paramIndex, int sqlType, java.lang.String typeName)`
`void` `setObject​(int index, java.lang.Object obj)`
`void` `setObject​(int n, java.lang.Object obj, int jdbcType)`
`void` `setObject​(int parameterIndex, java.lang.Object x, int targetSqlType, int scaleOrLength)`
`void` `setObject​(int parameterIndex, java.lang.Object x, int targetSqlType, java.lang.Integer precision, int scale)` Sets the value of the designated parameter with the given object.
`void` `setObject​(int parameterIndex, java.lang.Object x, int targetSqlType, java.lang.Integer precision, int scale, boolean forceEncrypt)` Sets the value of the designated parameter with the given object.
`void` `setRef​(int i, java.sql.Ref x)`
`void` `setRowId​(int parameterIndex, java.sql.RowId x)`
`void` `setShort​(int index, short x)`
`void` `setShort​(int index, short x, boolean forceEncrypt)` Sets the designated parameter to the given Java `short` value.
`void` `setSmallDateTime​(int n, java.sql.Timestamp x)` Sets the designated parameter to the given `java.sql.Timestamp` value
`void` `setSmallDateTime​(int n, java.sql.Timestamp x, boolean forceEncrypt)` Sets the designated parameter to the given `java.sql.Timestamp` value
`void` `setSmallMoney​(int n, java.math.BigDecimal x)` Sets the designated parameter to the given `java.math.BigDecimal` value.
`void` `setSmallMoney​(int n, java.math.BigDecimal x, boolean forceEncrypt)` Sets the designated parameter to the given `java.math.BigDecimal` value.
`void` `setSQLXML​(int parameterIndex, java.sql.SQLXML xmlObject)`
`void` `setString​(int index, java.lang.String str)`
`void` `setString​(int index, java.lang.String str, boolean forceEncrypt)` Sets the designated parameter to the given Java `String` value.
`void` `setStructured​(int n, java.lang.String tvpName, ISQLServerDataRecord tvpBulkRecord)` Populates a table valued parameter with a data table
`void` `setStructured​(int n, java.lang.String tvpName, SQLServerDataTable tvpDataTable)` Populates a table valued parameter with a data table
`void` `setStructured​(int n, java.lang.String tvpName, java.sql.ResultSet tvpResultSet)` Populates a table valued parameter with a data table
`void` `setTime​(int n, java.sql.Time x)`
`void` `setTime​(int n, java.sql.Time x, int scale)` Sets the designated parameter to the given `java.sql.Time` value
`void` `setTime​(int n, java.sql.Time x, int scale, boolean forceEncrypt)` Sets the designated parameter to the given `java.sql.Time` value
`void` `setTime​(int n, java.sql.Time x, java.util.Calendar cal)`
`void` `setTime​(int n, java.sql.Time x, java.util.Calendar cal, boolean forceEncrypt)` Sets the designated parameter to the given `java.sql.Time` value.
`void` `setTimestamp​(int n, java.sql.Timestamp x)`
`void` `setTimestamp​(int n, java.sql.Timestamp x, int scale)` Sets the designated parameter to the given `java.sql.Timestamp` value
`void` `setTimestamp​(int n, java.sql.Timestamp x, int scale, boolean forceEncrypt)` Sets the designated parameter to the given `java.sql.Timestamp` value
`void` `setTimestamp​(int n, java.sql.Timestamp x, java.util.Calendar cal)`
`void` `setTimestamp​(int n, java.sql.Timestamp x, java.util.Calendar cal, boolean forceEncrypt)` Sets the designated parameter to the given `java.sql.Timestamp` value.
`void` `setUnicodeStream​(int n, java.io.InputStream x, int length)` Deprecated.
`void` `setUniqueIdentifier​(int index, java.lang.String guid)` Sets the designated parameter to the given String.
`void` `setUniqueIdentifier​(int index, java.lang.String guid, boolean forceEncrypt)` Sets the designated parameter to the given String.
`void` `setURL​(int parameterIndex, java.net.URL x)`

### Methods inherited from interface com.microsoft.sqlserver.jdbc.ISQLServerStatement

`getResponseBuffering, setResponseBuffering`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface java.sql.PreparedStatement

`setObject, setObject`

### Methods inherited from class com.microsoft.sqlserver.jdbc.SQLServerStatement

`cancel, clearWarnings, close, closeOnCompletion, execute, execute, execute, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResponseBuffering, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, isWrapperFor, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, setResponseBuffering, toString, unwrap`

### Methods inherited from interface java.sql.Statement

`cancel, clearWarnings, close, closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, execute, execute, execute, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, isSimpleIdentifier, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout`

### Methods inherited from interface java.sql.Wrapper

`isWrapperFor, unwrap`

### Method Detail

#### getPreparedStatementHandle

    public int getPreparedStatementHandle​()
                                   throws SQLServerException

The server handle for this prepared statement. If a value < 1 is returned no handle has been created.

Returns:
  Per the description.
Throws:
  `SQLServerException` - when an error occurs

#### clearParameters

    public final void clearParameters​()
                               throws SQLServerException

Specified by:
  `clearParameters` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### executeQuery

    public java.sql.ResultSet executeQuery​()
                                    throws SQLServerException

Execute a query.

Specified by:
  `executeQuery` in interface `java.sql.PreparedStatement`
Returns:
  ResultSet
Throws:
  `SQLServerException` - when an error occurs

#### executeUpdate

    public int executeUpdate​()
                      throws SQLServerException

Specified by:
  `executeUpdate` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### executeLargeUpdate

    public long executeLargeUpdate​()
                            throws SQLServerException

Specified by:
  `executeLargeUpdate` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### execute

    public boolean execute​()
                    throws SQLServerException

Execute a query or non query statement.

Specified by:
  `execute` in interface `java.sql.PreparedStatement`
Returns:
  true if the statement returned a result set
Throws:
  `SQLServerException` - when an error occurs

#### getMetaData

    public final java.sql.ResultSetMetaData getMetaData​()
                                                 throws SQLServerException

Specified by:
  `getMetaData` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setAsciiStream

    public final void setAsciiStream​(int parameterIndex,
                                     java.io.InputStream x)
                              throws java.sql.SQLException

Specified by:
  `setAsciiStream` in interface `java.sql.PreparedStatement`
Throws:
  `java.sql.SQLException`

#### setAsciiStream

    public final void setAsciiStream​(int n,
                                     java.io.InputStream x,
                                     int length)
                              throws SQLServerException

Specified by:
  `setAsciiStream` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setAsciiStream

    public final void setAsciiStream​(int parameterIndex,
                                     java.io.InputStream x,
                                     long length)
                              throws java.sql.SQLException

Specified by:
  `setAsciiStream` in interface `java.sql.PreparedStatement`
Throws:
  `java.sql.SQLException`

#### setBigDecimal

    public final void setBigDecimal​(int n,
                                    java.math.BigDecimal x)
                             throws SQLServerException

Specified by:
  `setBigDecimal` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setBigDecimal

    public final void setBigDecimal​(int n,
                                    java.math.BigDecimal x,
                                    int precision,
                                    int scale)
                             throws SQLServerException

Sets the designated parameter to the given `java.math.BigDecimal` value. The driver converts this to an SQL `NUMERIC` value when it sends it to the database.

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `x` - the parameter value
  `precision` - the precision of the column
  `scale` - the scale of the column
Throws:
  `SQLServerException` - when an error occurs

#### setBigDecimal

    public final void setBigDecimal​(int n,
                                    java.math.BigDecimal x,
                                    int precision,
                                    int scale,
                                    boolean forceEncrypt)
                             throws SQLServerException

Sets the designated parameter to the given `java.math.BigDecimal` value. The driver converts this to an SQL `NUMERIC` value when it sends it to the database.

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `x` - the parameter value
  `precision` - the precision of the column
  `scale` - the scale of the column
  `forceEncrypt` - If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters.
Throws:
  `SQLServerException` - when an error occurs

#### setMoney

    public final void setMoney​(int n,
                               java.math.BigDecimal x)
                        throws SQLServerException

Sets the designated parameter to the given `java.math.BigDecimal` value. The driver converts this to an SQL `NUMERIC` value when it sends it to the database.

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `x` - the parameter value
Throws:
  `SQLServerException` - when an error occurs

#### setMoney

    public final void setMoney​(int n,
                               java.math.BigDecimal x,
                               boolean forceEncrypt)
                        throws SQLServerException

Sets the designated parameter to the given `java.math.BigDecimal` value. The driver converts this to an SQL `NUMERIC` value when it sends it to the database.

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `x` - the parameter value
  `forceEncrypt` - If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters.
Throws:
  `SQLServerException` - when an error occurs

#### setSmallMoney

    public final void setSmallMoney​(int n,
                                    java.math.BigDecimal x)
                             throws SQLServerException

Sets the designated parameter to the given `java.math.BigDecimal` value. The driver converts this to an SQL `NUMERIC` value when it sends it to the database.

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `x` - the parameter value
Throws:
  `SQLServerException` - when an error occurs

#### setSmallMoney

    public final void setSmallMoney​(int n,
                                    java.math.BigDecimal x,
                                    boolean forceEncrypt)
                             throws SQLServerException

Sets the designated parameter to the given `java.math.BigDecimal` value. The driver converts this to an SQL `NUMERIC` value when it sends it to the database.

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `x` - the parameter value
  `forceEncrypt` - If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters.
Throws:
  `SQLServerException` - when an error occurs

#### setBinaryStream

    public final void setBinaryStream​(int parameterIndex,
                                      java.io.InputStream x)
                               throws java.sql.SQLException

Specified by:
  `setBinaryStream` in interface `java.sql.PreparedStatement`
Throws:
  `java.sql.SQLException`

#### setBinaryStream

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

Specified by:
  `setBinaryStream` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setBinaryStream

    public final void setBinaryStream​(int parameterIndex,
                                      java.io.InputStream x,
                                      long length)
                               throws java.sql.SQLException

Specified by:
  `setBinaryStream` in interface `java.sql.PreparedStatement`
Throws:
  `java.sql.SQLException`

#### setBoolean

    public final void setBoolean​(int n,
                                 boolean x)
                          throws SQLServerException

Specified by:
  `setBoolean` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setBoolean

    public final void setBoolean​(int n,
                                 boolean x,
                                 boolean forceEncrypt)
                          throws SQLServerException

Sets the designated parameter to the given Java `boolean` value. The driver converts this to an SQL `BIT` or `BOOLEAN` value when it sends it to the database.

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `x` - the parameter value
  `forceEncrypt` - If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters.
Throws:
  `SQLServerException` - when an error occurs

#### setByte

    public final void setByte​(int n,
                              byte x)
                       throws SQLServerException

Specified by:
  `setByte` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setByte

    public final void setByte​(int n,
                              byte x,
                              boolean forceEncrypt)
                       throws SQLServerException

Sets the designated parameter to the given Java `byte` value. The driver converts this to an SQL `TINYINT` value when it sends it to the database.

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `x` - the parameter value
  `forceEncrypt` - If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters.
Throws:
  `SQLServerException` - when an error occurs

#### setBytes

    public final void setBytes​(int n,
                               byte[] x)
                        throws SQLServerException

Specified by:
  `setBytes` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setBytes

    public final void setBytes​(int n,
                               byte[] x,
                               boolean forceEncrypt)
                        throws SQLServerException

Sets the designated parameter to the given Java array of bytes. The driver converts this to an SQL `VARBINARY` or `LONGVARBINARY` (depending on the argument's size relative to the driver's limits on `VARBINARY` values) when it sends it to the database.

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `x` - the parameter value
  `forceEncrypt` - If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters.
Throws:
  `SQLServerException` - when an error occurs

#### setUniqueIdentifier

    public final void setUniqueIdentifier​(int index,
                                          java.lang.String guid)
                                   throws SQLServerException

Sets the designated parameter to the given String. The driver converts this to an SQL `GUID`

Parameters:
  `index` - the first parameter is 1, the second is 2, ...
  `guid` - string representation of the uniqueIdentifier value
Throws:
  `SQLServerException` - when an error occurs

#### setUniqueIdentifier

    public final void setUniqueIdentifier​(int index,
                                          java.lang.String guid,
                                          boolean forceEncrypt)
                                   throws SQLServerException

Sets the designated parameter to the given String. The driver converts this to an SQL `GUID`

Parameters:
  `index` - the first parameter is 1, the second is 2, ...
  `guid` - string representation of the uniqueIdentifier value
  `forceEncrypt` - If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters.
Throws:
  `SQLServerException` - when an error occurs

#### setDouble

    public final void setDouble​(int n,
                                double x)
                         throws SQLServerException

Specified by:
  `setDouble` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setDouble

    public final void setDouble​(int n,
                                double x,
                                boolean forceEncrypt)
                         throws SQLServerException

Sets the designated parameter to the given Java `double` value. The driver converts this to an SQL `DOUBLE` value when it sends it to the database.

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `x` - the parameter value
  `forceEncrypt` - If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters.
Throws:
  `SQLServerException` - when an error occurs

#### setFloat

    public final void setFloat​(int n,
                               float x)
                        throws SQLServerException

Specified by:
  `setFloat` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setFloat

    public final void setFloat​(int n,
                               float x,
                               boolean forceEncrypt)
                        throws SQLServerException

Sets the designated parameter to the given Java `float` value. The driver converts this to an SQL `REAL` value when it sends it to the database.

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `x` - the parameter value
  `forceEncrypt` - If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters.
Throws:
  `SQLServerException` - when an error occurs

#### setInt

    public final void setInt​(int n,
                             int value)
                      throws SQLServerException

Specified by:
  `setInt` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setInt

    public final void setInt​(int n,
                             int value,
                             boolean forceEncrypt)
                      throws SQLServerException

Sets the designated parameter to the given Java `int` value. The driver converts this to an SQL `INTEGER` value when it sends it to the database.

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `value` - the parameter value
  `forceEncrypt` - If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters.
Throws:
  `SQLServerException` - when an error occurs

#### setLong

    public final void setLong​(int n,
                              long x)
                       throws SQLServerException

Specified by:
  `setLong` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setLong

    public final void setLong​(int n,
                              long x,
                              boolean forceEncrypt)
                       throws SQLServerException

Sets the designated parameter to the given Java `long` value. The driver converts this to an SQL `BIGINT` value when it sends it to the database.

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `x` - the parameter value
  `forceEncrypt` - If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters.
Throws:
  `SQLServerException` - when an error occurs

#### setNull

    public final void setNull​(int index,
                              int jdbcType)
                       throws SQLServerException

Specified by:
  `setNull` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setObject

    public final void setObject​(int index,
                                java.lang.Object obj)
                         throws SQLServerException

Specified by:
  `setObject` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setObject

    public final void setObject​(int n,
                                java.lang.Object obj,
                                int jdbcType)
                         throws SQLServerException

Specified by:
  `setObject` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setObject

    public final void setObject​(int parameterIndex,
                                java.lang.Object x,
                                int targetSqlType,
                                int scaleOrLength)
                         throws SQLServerException

Specified by:
  `setObject` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setObject

    public final void setObject​(int parameterIndex,
                                java.lang.Object x,
                                int targetSqlType,
                                java.lang.Integer precision,
                                int scale)
                         throws SQLServerException

Sets the value of the designated parameter with the given object.

The given Java object will be converted to the given targetSqlType before being sent to the database. If the object has a custom mapping (is of a class implementing the interface `SQLData`), the JDBC driver should call the method `SQLData.writeSQL` to write it to the SQL data stream. If, on the other hand, the object is of a class implementing `Ref`, `Blob`, `Clob`, `NClob`, `Struct`, `java.net.URL`, or `Array`, the driver should pass it to the database as a value of the corresponding SQL type.

Note that this method may be used to pass database-specific abstract data types.

Parameters:
  `parameterIndex` - the first parameter is 1, the second is 2, ...
  `x` - the object containing the input parameter value
  `targetSqlType` - the SQL type (as defined in java.sql.Types) to be sent to the database. The scale argument may further qualify this type.
  `precision` - the precision of the column
  `scale` - scale of the column
Throws:
  `SQLServerException` - when an error occurs

#### setObject

    public final void setObject​(int parameterIndex,
                                java.lang.Object x,
                                int targetSqlType,
                                java.lang.Integer precision,
                                int scale,
                                boolean forceEncrypt)
                         throws SQLServerException

Sets the value of the designated parameter with the given object.

The given Java object will be converted to the given targetSqlType before being sent to the database. If the object has a custom mapping (is of a class implementing the interface `SQLData`), the JDBC driver should call the method `SQLData.writeSQL` to write it to the SQL data stream. If, on the other hand, the object is of a class implementing `Ref`, `Blob`, `Clob`, `NClob`, `Struct`, `java.net.URL`, or `Array`, the driver should pass it to the database as a value of the corresponding SQL type.

Note that this method may be used to pass database-specific abstract data types.

Parameters:
  `parameterIndex` - the first parameter is 1, the second is 2, ...
  `x` - the object containing the input parameter value
  `targetSqlType` - the SQL type (as defined in java.sql.Types) to be sent to the database. The scale argument may further qualify this type.
  `precision` - the precision of the column
  `scale` - scale of the column
  `forceEncrypt` - If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters.
Throws:
  `SQLServerException` - when an error occurs

#### setShort

    public final void setShort​(int index,
                               short x)
                        throws SQLServerException

Specified by:
  `setShort` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setShort

    public final void setShort​(int index,
                               short x,
                               boolean forceEncrypt)
                        throws SQLServerException

Sets the designated parameter to the given Java `short` value. The driver converts this to an SQL `SMALLINT` value when it sends it to the database.

Parameters:
  `index` - the first parameter is 1, the second is 2, ...
  `x` - the parameter value
  `forceEncrypt` - If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters.
Throws:
  `SQLServerException` - when an error occurs

#### setString

    public final void setString​(int index,
                                java.lang.String str)
                         throws SQLServerException

Specified by:
  `setString` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setString

    public final void setString​(int index,
                                java.lang.String str,
                                boolean forceEncrypt)
                         throws SQLServerException

Sets the designated parameter to the given Java `String` value. The driver converts this to an SQL `VARCHAR` or `LONGVARCHAR` value (depending on the argument's size relative to the driver's limits on `VARCHAR` values) when it sends it to the database.

Parameters:
  `index` - the first parameter is 1, the second is 2, ...
  `str` - the parameter value
  `forceEncrypt` - If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters.
Throws:
  `SQLServerException` - when an error occurs

#### setNString

    public final void setNString​(int parameterIndex,
                                 java.lang.String value)
                          throws java.sql.SQLException

Specified by:
  `setNString` in interface `java.sql.PreparedStatement`
Throws:
  `java.sql.SQLException`

#### setNString

    public final void setNString​(int parameterIndex,
                                 java.lang.String value,
                                 boolean forceEncrypt)
                          throws java.sql.SQLException

Sets the designated parameter to the given `String` object. The driver converts this to a SQL `NCHAR` or `NVARCHAR` or `LONGNVARCHAR` value (depending on the argument's size relative to the driver's limits on `NVARCHAR` values) when it sends it to the database.

Parameters:
  `parameterIndex` - of the first parameter is 1, the second is 2, ...
  `value` - the parameter value
  `forceEncrypt` - If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters.
Throws:
  `java.sql.SQLException` - when an error occurs

#### setTime

    public final void setTime​(int n,
                              java.sql.Time x)
                       throws SQLServerException

Specified by:
  `setTime` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setTime

    public final void setTime​(int n,
                              java.sql.Time x,
                              int scale)
                       throws SQLServerException

Sets the designated parameter to the given `java.sql.Time` value

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `x` - the parameter value
  `scale` - the scale of the column
Throws:
  `SQLServerException` - when an error occurs

#### setTime

    public final void setTime​(int n,
                              java.sql.Time x,
                              int scale,
                              boolean forceEncrypt)
                       throws SQLServerException

Sets the designated parameter to the given `java.sql.Time` value

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `x` - the parameter value
  `scale` - the scale of the column
  `forceEncrypt` - If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters.
Throws:
  `SQLServerException` - when an error occurs

#### setTimestamp

    public final void setTimestamp​(int n,
                                   java.sql.Timestamp x)
                            throws SQLServerException

Specified by:
  `setTimestamp` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setTimestamp

    public final void setTimestamp​(int n,
                                   java.sql.Timestamp x,
                                   int scale)
                            throws SQLServerException

Sets the designated parameter to the given `java.sql.Timestamp` value

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `x` - the parameter value
  `scale` - the scale of the column
Throws:
  `SQLServerException` - when an error occurs

#### setTimestamp

    public final void setTimestamp​(int n,
                                   java.sql.Timestamp x,
                                   int scale,
                                   boolean forceEncrypt)
                            throws SQLServerException

Sets the designated parameter to the given `java.sql.Timestamp` value

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `x` - the parameter value
  `scale` - the scale of the column
  `forceEncrypt` - If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters.
Throws:
  `SQLServerException` - when an error occurs

#### setDateTimeOffset

    public final void setDateTimeOffset​(int n,
                                        DateTimeOffset x)
                                 throws java.sql.SQLException

Sets the designated parameter to the given `microsoft.sql.DatetimeOffset` value

Specified by:
  `setDateTimeOffset` in interface `ISQLServerPreparedStatement`
Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `x` - the parameter value
Throws:
  `java.sql.SQLException` - if an error occurs.

#### setDateTimeOffset

    public final void setDateTimeOffset​(int n,
                                        DateTimeOffset x,
                                        int scale)
                                 throws java.sql.SQLException

Sets the designated parameter to the given `microsoft.sql.DatetimeOffset` value

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `x` - the parameter value
  `scale` - the scale of the column
Throws:
  `java.sql.SQLException` - when an error occurs

#### setDateTimeOffset

    public final void setDateTimeOffset​(int n,
                                        DateTimeOffset x,
                                        int scale,
                                        boolean forceEncrypt)
                                 throws java.sql.SQLException

Sets the designated parameter to the given `microsoft.sql.DatetimeOffset` value

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `x` - the parameter value
  `scale` - the scale of the column
  `forceEncrypt` - If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters.
Throws:
  `java.sql.SQLException` - when an error occurs

#### setDate

    public final void setDate​(int n,
                              java.sql.Date x)
                       throws SQLServerException

Specified by:
  `setDate` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setDateTime

    public final void setDateTime​(int n,
                                  java.sql.Timestamp x)
                           throws SQLServerException

Sets the designated parameter to the given `java.sql.Timestamp` value

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `x` - the parameter value
Throws:
  `SQLServerException` - when an error occurs

#### setDateTime

    public final void setDateTime​(int n,
                                  java.sql.Timestamp x,
                                  boolean forceEncrypt)
                           throws SQLServerException

Sets the designated parameter to the given `java.sql.Timestamp` value

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `x` - the parameter value
  `forceEncrypt` - If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters.
Throws:
  `SQLServerException` - when an error occurs

#### setSmallDateTime

    public final void setSmallDateTime​(int n,
                                       java.sql.Timestamp x)
                                throws SQLServerException

Sets the designated parameter to the given `java.sql.Timestamp` value

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `x` - the parameter value
Throws:
  `SQLServerException` - when an error occurs

#### setSmallDateTime

    public final void setSmallDateTime​(int n,
                                       java.sql.Timestamp x,
                                       boolean forceEncrypt)
                                throws SQLServerException

Sets the designated parameter to the given `java.sql.Timestamp` value

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `x` - the parameter value
  `forceEncrypt` - If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters.
Throws:
  `SQLServerException` - when an error occurs

#### setStructured

    public final void setStructured​(int n,
                                    java.lang.String tvpName,
                                    SQLServerDataTable tvpDataTable)
                             throws SQLServerException

Populates a table valued parameter with a data table

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `tvpName` - the name of the table valued parameter
  `tvpDataTable` - the source datatable object
Throws:
  `SQLServerException` - when an error occurs

#### setStructured

    public final void setStructured​(int n,
                                    java.lang.String tvpName,
                                    java.sql.ResultSet tvpResultSet)
                             throws SQLServerException

Populates a table valued parameter with a data table

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `tvpName` - the name of the table valued parameter
  `tvpResultSet` - the source resultset object
Throws:
  `SQLServerException` - when an error occurs

#### setStructured

    public final void setStructured​(int n,
                                    java.lang.String tvpName,
                                    ISQLServerDataRecord tvpBulkRecord)
                             throws SQLServerException

Populates a table valued parameter with a data table

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `tvpName` - the name of the table valued parameter
  `tvpBulkRecord` - an ISQLServerDataRecord object
Throws:
  `SQLServerException` - when an error occurs

#### setUnicodeStream

    @Deprecated
    public final void setUnicodeStream​(int n,
                                       java.io.InputStream x,
                                       int length)
                                throws java.sql.SQLException

Deprecated.

Specified by:
  `setUnicodeStream` in interface `java.sql.PreparedStatement`
Throws:
  `java.sql.SQLException`

#### addBatch

    public final void addBatch​()
                        throws SQLServerException

Specified by:
  `addBatch` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### clearBatch

    public final void clearBatch​()
                          throws SQLServerException

Specified by:
  `clearBatch` in interface `java.sql.Statement`
Overrides:
  `clearBatch` in class `SQLServerStatement`
Throws:
  `SQLServerException`

#### executeBatch

    public int[] executeBatch​()
                       throws SQLServerException,
                              java.sql.BatchUpdateException

Description copied from class: `SQLServerStatement`
Send a batch of statements to the database.

Specified by:
  `executeBatch` in interface `java.sql.Statement`
Overrides:
  `executeBatch` in class `SQLServerStatement`
Throws:
  `SQLServerException`
  `java.sql.BatchUpdateException`

#### executeLargeBatch

    public long[] executeLargeBatch​()
                             throws SQLServerException,
                                    java.sql.BatchUpdateException

Specified by:
  `executeLargeBatch` in interface `java.sql.Statement`
Overrides:
  `executeLargeBatch` in class `SQLServerStatement`
Throws:
  `SQLServerException`
  `java.sql.BatchUpdateException`

#### setCharacterStream

    public final void setCharacterStream​(int parameterIndex,
                                         java.io.Reader reader)
                                  throws java.sql.SQLException

Specified by:
  `setCharacterStream` in interface `java.sql.PreparedStatement`
Throws:
  `java.sql.SQLException`

#### setCharacterStream

    public final void setCharacterStream​(int n,
                                         java.io.Reader reader,
                                         int length)
                                  throws SQLServerException

Specified by:
  `setCharacterStream` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setCharacterStream

    public final void setCharacterStream​(int parameterIndex,
                                         java.io.Reader reader,
                                         long length)
                                  throws java.sql.SQLException

Specified by:
  `setCharacterStream` in interface `java.sql.PreparedStatement`
Throws:
  `java.sql.SQLException`

#### setNCharacterStream

    public final void setNCharacterStream​(int parameterIndex,
                                          java.io.Reader value)
                                   throws java.sql.SQLException

Specified by:
  `setNCharacterStream` in interface `java.sql.PreparedStatement`
Throws:
  `java.sql.SQLException`

#### setNCharacterStream

    public final void setNCharacterStream​(int parameterIndex,
                                          java.io.Reader value,
                                          long length)
                                   throws java.sql.SQLException

Specified by:
  `setNCharacterStream` in interface `java.sql.PreparedStatement`
Throws:
  `java.sql.SQLException`

#### setRef

    public final void setRef​(int i,
                             java.sql.Ref x)
                      throws SQLServerException

Specified by:
  `setRef` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setBlob

    public final void setBlob​(int i,
                              java.sql.Blob x)
                       throws java.sql.SQLException

Specified by:
  `setBlob` in interface `java.sql.PreparedStatement`
Throws:
  `java.sql.SQLException`

#### setBlob

    public final void setBlob​(int parameterIndex,
                              java.io.InputStream inputStream)
                       throws java.sql.SQLException

Specified by:
  `setBlob` in interface `java.sql.PreparedStatement`
Throws:
  `java.sql.SQLException`

#### setBlob

    public final void setBlob​(int parameterIndex,
                              java.io.InputStream inputStream,
                              long length)
                       throws java.sql.SQLException

Specified by:
  `setBlob` in interface `java.sql.PreparedStatement`
Throws:
  `java.sql.SQLException`

#### setClob

    public final void setClob​(int parameterIndex,
                              java.sql.Clob clobValue)
                       throws java.sql.SQLException

Specified by:
  `setClob` in interface `java.sql.PreparedStatement`
Throws:
  `java.sql.SQLException`

#### setClob

    public final void setClob​(int parameterIndex,
                              java.io.Reader reader)
                       throws java.sql.SQLException

Specified by:
  `setClob` in interface `java.sql.PreparedStatement`
Throws:
  `java.sql.SQLException`

#### setClob

    public final void setClob​(int parameterIndex,
                              java.io.Reader reader,
                              long length)
                       throws java.sql.SQLException

Specified by:
  `setClob` in interface `java.sql.PreparedStatement`
Throws:
  `java.sql.SQLException`

#### setNClob

    public final void setNClob​(int parameterIndex,
                               java.sql.NClob value)
                        throws java.sql.SQLException

Specified by:
  `setNClob` in interface `java.sql.PreparedStatement`
Throws:
  `java.sql.SQLException`

#### setNClob

    public final void setNClob​(int parameterIndex,
                               java.io.Reader reader)
                        throws java.sql.SQLException

Specified by:
  `setNClob` in interface `java.sql.PreparedStatement`
Throws:
  `java.sql.SQLException`

#### setNClob

    public final void setNClob​(int parameterIndex,
                               java.io.Reader reader,
                               long length)
                        throws java.sql.SQLException

Specified by:
  `setNClob` in interface `java.sql.PreparedStatement`
Throws:
  `java.sql.SQLException`

#### setArray

    public final void setArray​(int i,
                               java.sql.Array x)
                        throws SQLServerException

Specified by:
  `setArray` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setDate

    public final void setDate​(int n,
                              java.sql.Date x,
                              java.util.Calendar cal)
                       throws SQLServerException

Specified by:
  `setDate` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setDate

    public final void setDate​(int n,
                              java.sql.Date x,
                              java.util.Calendar cal,
                              boolean forceEncrypt)
                       throws SQLServerException

Sets the designated parameter to the given `java.sql.Date` value, using the given `Calendar` object. The driver uses the `Calendar` object to construct an SQL `DATE` value, which the driver then sends to the database. With a `Calendar` object, the driver can calculate the date taking into account a custom timezone. If no `Calendar` object is specified, the driver uses the default timezone, which is that of the virtual machine running the application.

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `x` - the parameter value
  `cal` - the `Calendar` object the driver will use to construct the date
  `forceEncrypt` - If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters.
Throws:
  `SQLServerException` - when an error occurs

#### setTime

    public final void setTime​(int n,
                              java.sql.Time x,
                              java.util.Calendar cal)
                       throws SQLServerException

Specified by:
  `setTime` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setTime

    public final void setTime​(int n,
                              java.sql.Time x,
                              java.util.Calendar cal,
                              boolean forceEncrypt)
                       throws SQLServerException

Sets the designated parameter to the given `java.sql.Time` value. The driver converts this to an SQL `TIME` value when it sends it to the database.

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `x` - the parameter value
  `cal` - the `Calendar` object the driver will use to construct the date
  `forceEncrypt` - If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters.
Throws:
  `SQLServerException` - when an error occurs

#### setTimestamp

    public final void setTimestamp​(int n,
                                   java.sql.Timestamp x,
                                   java.util.Calendar cal)
                            throws SQLServerException

Specified by:
  `setTimestamp` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setTimestamp

    public final void setTimestamp​(int n,
                                   java.sql.Timestamp x,
                                   java.util.Calendar cal,
                                   boolean forceEncrypt)
                            throws SQLServerException

Sets the designated parameter to the given `java.sql.Timestamp` value. The driver converts this to an SQL `TIMESTAMP` value when it sends it to the database.

Parameters:
  `n` - the first parameter is 1, the second is 2, ...
  `x` - the parameter value
  `cal` - the `Calendar` object the driver will use to construct the date
  `forceEncrypt` - If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters.
Throws:
  `SQLServerException` - when an error occurs

#### setNull

    public final void setNull​(int paramIndex,
                              int sqlType,
                              java.lang.String typeName)
                       throws SQLServerException

Specified by:
  `setNull` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### getParameterMetaData

    public final java.sql.ParameterMetaData getParameterMetaData​(boolean forceRefresh)
                                                          throws SQLServerException

Returns parameter metadata for the prepared statement.

Parameters:
  `forceRefresh` - : If true the cache will not be used to retrieve the metadata.
Returns:
  Per the description.
Throws:
  `SQLServerException` - when an error occurs

#### getParameterMetaData

    public final java.sql.ParameterMetaData getParameterMetaData​()
                                                          throws SQLServerException

Specified by:
  `getParameterMetaData` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setURL

    public final void setURL​(int parameterIndex,
                             java.net.URL x)
                      throws SQLServerException

Specified by:
  `setURL` in interface `java.sql.PreparedStatement`
Throws:
  `SQLServerException`

#### setRowId

    public final void setRowId​(int parameterIndex,
                               java.sql.RowId x)
                        throws java.sql.SQLException

Specified by:
  `setRowId` in interface `java.sql.PreparedStatement`
Throws:
  `java.sql.SQLException`

#### setSQLXML

    public final void setSQLXML​(int parameterIndex,
                                java.sql.SQLXML xmlObject)
                         throws java.sql.SQLException

Specified by:
  `setSQLXML` in interface `java.sql.PreparedStatement`
Throws:
  `java.sql.SQLException`

#### executeUpdate

    public final int executeUpdate​(java.lang.String sql)
                            throws SQLServerException

Description copied from class: `SQLServerStatement`
Execute a JDBC update

Specified by:
  `executeUpdate` in interface `java.sql.Statement`
Overrides:
  `executeUpdate` in class `SQLServerStatement`
Parameters:
  `sql` - the SQL query
Returns:
  The number of rows updated.
Throws:
  `SQLServerException` - The SQL was invalid.

#### execute

    public final boolean execute​(java.lang.String sql)
                          throws SQLServerException

Description copied from class: `SQLServerStatement`
Execute an update or query.

Specified by:
  `execute` in interface `java.sql.Statement`
Overrides:
  `execute` in class `SQLServerStatement`
Parameters:
  `sql` - The update or query.
Returns:
  True if a result set was generated.
Throws:
  `SQLServerException` - The SQL statement was not valid.

#### executeQuery

    public final java.sql.ResultSet executeQuery​(java.lang.String sql)
                                          throws SQLServerException

Description copied from class: `SQLServerStatement`
Execute a result set query

Specified by:
  `executeQuery` in interface `java.sql.Statement`
Overrides:
  `executeQuery` in class `SQLServerStatement`
Parameters:
  `sql` - the SQL query
Returns:
  a JDBC result set.
Throws:
  `SQLServerException` - The SQL was invalid.

#### addBatch

    public void addBatch​(java.lang.String sql)
                  throws SQLServerException

Specified by:
  `addBatch` in interface `java.sql.Statement`
Overrides:
  `addBatch` in class `SQLServerStatement`
Throws:
  `SQLServerException`