Package com.microsoft.sqlserver.jdbc

## Class SQLServerPreparedStatement42

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

All Implemented Interfaces:
  `ISQLServerPreparedStatement`, `ISQLServerPreparedStatement42`, `ISQLServerStatement`, `AutoCloseable`, `PreparedStatement`, `Statement`, `Wrapper`

    public class SQLServerPreparedStatement42
    extends SQLServerPreparedStatement
    implements ISQLServerPreparedStatement42

This class is separated from SQLServerPreparedStatement class in order to resolve compiling error of missing Java 8 Types when running with Java 7. This class will be initialized instead of SQLServerPreparedStatement when Java 8 and JDBC 4.2 are used. It shares the same PreparedStatement implementation with SQLServerCallableStatement42.

### 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
`void` `setObject​(int index, Object obj, SQLType jdbcType)`
`void` `setObject​(int parameterIndex, Object x, SQLType targetSqlType, int scaleOrLength)`
`void` `setObject​(int parameterIndex, Object x, SQLType targetSqlType, Integer precision, Integer scale)` Sets the value of the designated parameter with the given object.
`void` `setObject​(int parameterIndex, Object x, SQLType targetSqlType, Integer precision, Integer scale, boolean forceEncrypt)` Sets the value of the designated parameter with the given object.

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

`setDateTimeOffset`

### 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

`addBatch, clearParameters, execute, executeLargeUpdate, executeQuery, executeUpdate, getMetaData, getParameterMetaData, setArray, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setNull, setObject, setObject, setObject, setRef, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL`

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

`addBatch, addBatch, clearBatch, clearParameters, execute, execute, executeBatch, executeLargeBatch, executeLargeUpdate, executeQuery, executeQuery, executeUpdate, executeUpdate, getMetaData, getParameterMetaData, getParameterMetaData, getPreparedStatementHandle, setArray, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBigDecimal, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setBoolean, setByte, setByte, setBytes, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDate, setDateTime, setDateTime, setDateTimeOffset, setDateTimeOffset, setDateTimeOffset, setDouble, setDouble, setFloat, setFloat, setGeography, setGeometry, setInt, setInt, setLong, setLong, setMoney, setMoney, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNString, setNull, setNull, setObject, setObject, setObject, setObject, setObject, setRef, setRowId, setShort, setShort, setSmallDateTime, setSmallDateTime, setSmallMoney, setSmallMoney, setSQLXML, setString, setString, setStructured, setStructured, setStructured, setTime, setTime, setTime, setTime, setTime, setTimestamp, setTimestamp, setTimestamp, setTimestamp, setTimestamp, setUnicodeStream, setUniqueIdentifier, setUniqueIdentifier, setURL`

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

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

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

`addBatch, cancel, clearBatch, clearWarnings, close, closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, execute, execute, execute, execute, executeBatch, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, 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

#### setObject

    public final void setObject​(int index,
                                Object obj,
                                SQLType jdbcType)
                         throws SQLServerException

Specified by:
  `setObject` in interface `ISQLServerPreparedStatement42`
Specified by:
  `setObject` in interface `PreparedStatement`
Throws:
  `SQLServerException`

#### setObject

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

Specified by:
  `setObject` in interface `ISQLServerPreparedStatement42`
Specified by:
  `setObject` in interface `PreparedStatement`
Throws:
  `SQLServerException`

#### setObject

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

Description copied from interface: `ISQLServerPreparedStatement42`
Sets the value of the designated parameter with the given object. This method is similar to `ISQLServerPreparedStatement42.setObject(int parameterIndex, Object x, SQLType targetSqlType, int scaleOrLength)`, except that it assumes a scale of zero.

The default implementation will throw `SQLFeatureNotSupportedException`

Specified by:
  `setObject` in interface `ISQLServerPreparedStatement42`
Parameters:
  `parameterIndex` - the first parameter is 1, the second is 2, ...
  `x` - the object containing the input parameter value
  `targetSqlType` - the SQL type to be sent to the database
  `precision` - the precision of the column
  `scale` - the scale of the column
Throws:
  `SQLServerException` - if parameterIndex does not correspond to a parameter marker in the SQL statement; if a database access error occurs or this method is called on a closed `PreparedStatement`

#### setObject

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

Description copied from interface: `ISQLServerPreparedStatement42`
Sets the value of the designated parameter with the given object. This method is similar to `ISQLServerPreparedStatement42.setObject(int parameterIndex, Object x, SQLType targetSqlType, int scaleOrLength)`, except that it assumes a scale of zero.

The default implementation will throw `SQLFeatureNotSupportedException`

Specified by:
  `setObject` in interface `ISQLServerPreparedStatement42`
Parameters:
  `parameterIndex` - the first parameter is 1, the second is 2, ...
  `x` - the object containing the input parameter value
  `targetSqlType` - the SQL type to be sent to the database
  `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` - if parameterIndex does not correspond to a parameter marker in the SQL statement; if a database access error occurs or this method is called on a closed `PreparedStatement`