Class SQLServerPreparedStatement
- java.lang.Object
-
- com.microsoft.sqlserver.jdbc.SQLServerStatement
-
- com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement
-
- All Implemented Interfaces:
ISQLServerPreparedStatement
,ISQLServerStatement
,Serializable
,AutoCloseable
,PreparedStatement
,Statement
,Wrapper
- Direct Known Subclasses:
SQLServerCallableStatement
public class SQLServerPreparedStatement extends SQLServerStatement implements ISQLServerPreparedStatement
Provides an implementation of java.sql.PreparedStatement interface that assists in preparing Statements for SQL Server.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.
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.microsoft.sqlserver.jdbc.SQLServerStatement
isSetByIndex, isSetByName, stmtColumnEncriptionSetting, USER_DEFINED_FUNCTION_RETURN_STATUS
-
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 Modifier and Type Method Description void
addBatch()
void
addBatch(String sql)
void
clearBatch()
void
clearParameters()
boolean
execute()
boolean
execute(String sql)
int[]
executeBatch()
Sends a batch of statements to the database.long[]
executeLargeBatch()
long
executeLargeUpdate()
ResultSet
executeQuery()
ResultSet
executeQuery(String sql)
int
executeUpdate()
int
executeUpdate(String sql)
ResultSetMetaData
getMetaData()
ParameterMetaData
getParameterMetaData()
ParameterMetaData
getParameterMetaData(boolean forceRefresh)
Returns parameter metadata for the prepared statement.int
getPreparedStatementHandle()
The server handle for this prepared statement.boolean
getUseFmtOnly()
Returns the current flag value for useFmtOnly.void
setArray(int i, Array x)
void
setAsciiStream(int parameterIndex, InputStream x)
void
setAsciiStream(int n, InputStream x, int length)
void
setAsciiStream(int parameterIndex, InputStream x, long length)
void
setBigDecimal(int parameterIndex, BigDecimal x)
void
setBigDecimal(int parameterIndex, BigDecimal x, int precision, int scale)
Sets the designated parameter to the givenjava.math.BigDecimal
value.void
setBigDecimal(int parameterIndex, BigDecimal x, int precision, int scale, boolean forceEncrypt)
Sets the designated parameter to the givenjava.math.BigDecimal
value.void
setBinaryStream(int parameterIndex, InputStream x)
void
setBinaryStream(int n, InputStream x, int length)
void
setBinaryStream(int parameterIndex, InputStream x, long length)
void
setBlob(int parameterIndex, InputStream inputStream)
void
setBlob(int parameterIndex, InputStream inputStream, long length)
void
setBlob(int i, Blob x)
void
setBoolean(int n, boolean x)
void
setBoolean(int n, boolean x, boolean forceEncrypt)
Sets the designated parameter to the given Javaboolean
value.void
setByte(int n, byte x)
void
setByte(int n, byte x, boolean forceEncrypt)
Sets the designated parameter to the given Javabyte
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, Reader reader)
void
setCharacterStream(int n, Reader reader, int length)
void
setCharacterStream(int parameterIndex, Reader reader, long length)
void
setClob(int parameterIndex, Reader reader)
void
setClob(int parameterIndex, Reader reader, long length)
void
setClob(int parameterIndex, Clob clobValue)
void
setDate(int n, Date x)
void
setDate(int n, Date x, Calendar cal)
void
setDate(int n, Date x, Calendar cal, boolean forceEncrypt)
Sets the designated parameter to the givenjava.sql.Date
value, using the givenCalendar
object.void
setDateTime(int n, Timestamp x)
Sets the designated parameter to the givenjava.sql.Timestamp
value.void
setDateTime(int n, Timestamp x, boolean forceEncrypt)
Sets the designated parameter to the givenjava.sql.Timestamp
value.void
setDateTimeOffset(int n, DateTimeOffset x)
Sets the designated parameter to the givenmicrosoft.sql.DateTimeOffset
value.void
setDateTimeOffset(int n, DateTimeOffset x, int scale)
Sets the designated parameter to the givenmicrosoft.sql.DatetimeOffset
value.void
setDateTimeOffset(int n, DateTimeOffset x, int scale, boolean forceEncrypt)
Sets the designated parameter to the givenmicrosoft.sql.DatetimeOffset
value.void
setDouble(int n, double x)
void
setDouble(int n, double x, boolean forceEncrypt)
Sets the designated parameter to the given Javadouble
value.void
setFloat(int n, float x)
void
setFloat(int n, float x, boolean forceEncrypt)
Sets the designated parameter to the given Javafloat
value.void
setGeography(int n, Geography x)
Sets the designated parameter to the givenmicrosoft.sql.Geography
Class object.void
setGeometry(int n, Geometry x)
Sets the designated parameter to the givenmicrosoft.sql.Geometry
Class object.void
setInt(int n, int value)
void
setInt(int n, int value, boolean forceEncrypt)
Sets the designated parameter to the given Javaint
value.void
setLong(int n, long x)
void
setLong(int n, long x, boolean forceEncrypt)
Sets the designated parameter to the given Javalong
value.void
setMoney(int n, BigDecimal x)
Sets the designated parameter to the givenjava.math.BigDecimal
value.void
setMoney(int n, BigDecimal x, boolean forceEncrypt)
Sets the designated parameter to the givenjava.math.BigDecimal
value.void
setNCharacterStream(int parameterIndex, Reader value)
void
setNCharacterStream(int parameterIndex, Reader value, long length)
void
setNClob(int parameterIndex, Reader reader)
void
setNClob(int parameterIndex, Reader reader, long length)
void
setNClob(int parameterIndex, NClob value)
void
setNString(int parameterIndex, String value)
void
setNString(int parameterIndex, String value, boolean forceEncrypt)
Sets the designated parameter to the givenString
object.void
setNull(int index, int jdbcType)
void
setNull(int paramIndex, int sqlType, String typeName)
void
setObject(int index, Object obj)
void
setObject(int n, Object obj, int jdbcType)
void
setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength)
void
setObject(int parameterIndex, Object x, int targetSqlType, Integer precision, int scale)
Sets the value of the designated parameter with the given object.void
setObject(int parameterIndex, Object x, int targetSqlType, Integer precision, int scale, boolean forceEncrypt)
Sets the value of the designated parameter with the given object.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.void
setRef(int i, Ref x)
void
setRowId(int parameterIndex, RowId x)
void
setShort(int index, short x)
void
setShort(int index, short x, boolean forceEncrypt)
Sets the designated parameter to the given Javashort
value.void
setSmallDateTime(int n, Timestamp x)
Sets the designated parameter to the givenjava.sql.Timestamp
value.void
setSmallDateTime(int n, Timestamp x, boolean forceEncrypt)
Sets the designated parameter to the givenjava.sql.Timestamp
value.void
setSmallMoney(int n, BigDecimal x)
Sets the designated parameter to the givenjava.math.BigDecimal
value.void
setSmallMoney(int n, BigDecimal x, boolean forceEncrypt)
Sets the designated parameter to the givenjava.math.BigDecimal
value.void
setSQLXML(int parameterIndex, SQLXML xmlObject)
void
setString(int index, String str)
void
setString(int index, String str, boolean forceEncrypt)
Sets the designated parameter to the given JavaString
value.void
setStructured(int n, String tvpName, ISQLServerDataRecord tvpBulkRecord)
Sets the server bulk record to populate a table valued parameter.void
setStructured(int n, String tvpName, SQLServerDataTable tvpDataTable)
Sets the data table to populates a table valued parameter.void
setStructured(int n, String tvpName, ResultSet tvpResultSet)
Sets the result set to populate a table-valued parameter.void
setTime(int n, Time x)
void
setTime(int n, Time x, int scale)
Sets the designated parameter to the givenjava.sql.Time
value.void
setTime(int n, Time x, int scale, boolean forceEncrypt)
Sets the designated parameter to the givenjava.sql.Time
value.void
setTime(int n, Time x, Calendar cal)
void
setTime(int n, Time x, Calendar cal, boolean forceEncrypt)
Sets the designated parameter to the givenjava.sql.Time
value.void
setTimestamp(int n, Timestamp x)
void
setTimestamp(int n, Timestamp x, int scale)
Sets the designated parameter to the givenjava.sql.Timestamp
value.void
setTimestamp(int n, Timestamp x, int scale, boolean forceEncrypt)
Sets the designated parameter to the givenjava.sql.Timestamp
value.void
setTimestamp(int n, Timestamp x, Calendar cal)
void
setTimestamp(int n, Timestamp x, Calendar cal, boolean forceEncrypt)
Sets the designated parameter to the givenjava.sql.Timestamp
value.void
setUnicodeStream(int n, InputStream x, int length)
Deprecated.void
setUniqueIdentifier(int index, String guid)
Sets the designated parameter to the given String.void
setUniqueIdentifier(int index, String guid, boolean forceEncrypt)
Sets the designated parameter to the given String.void
setURL(int parameterIndex, URL x)
void
setUseFmtOnly(boolean useFmtOnly)
Specifies the flag to use FMTONLY for parameter metadata queries.String
toString()
Returns the prepared statement SQL-
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, getStmtColumnEncriptionSetting, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, isWrapperFor, registerColumnEncryptionKeyStoreProvidersOnStatement, setCancelQueryTimeout, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, setResponseBuffering, unwrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.microsoft.sqlserver.jdbc.ISQLServerStatement
getCancelQueryTimeout, getResponseBuffering, setCancelQueryTimeout, setResponseBuffering
-
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
-
toString
public String toString()
Returns the prepared statement SQL- Overrides:
toString
in classSQLServerStatement
-
getPreparedStatementHandle
public int getPreparedStatementHandle() throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
The server handle for this prepared statement. If a value < 1 is returned no handle has been created.- Specified by:
getPreparedStatementHandle
in interfaceISQLServerPreparedStatement
- Returns:
- Per the description.
- Throws:
SQLServerException
- when an error occurs
-
clearParameters
public final void clearParameters() throws SQLServerException
- Specified by:
clearParameters
in interfacePreparedStatement
- Throws:
SQLServerException
-
executeQuery
public ResultSet executeQuery() throws SQLServerException, SQLTimeoutException
- Specified by:
executeQuery
in interfacePreparedStatement
- Throws:
SQLServerException
SQLTimeoutException
-
executeUpdate
public int executeUpdate() throws SQLServerException, SQLTimeoutException
- Specified by:
executeUpdate
in interfacePreparedStatement
- Throws:
SQLServerException
SQLTimeoutException
-
executeLargeUpdate
public long executeLargeUpdate() throws SQLServerException, SQLTimeoutException
- Specified by:
executeLargeUpdate
in interfacePreparedStatement
- Throws:
SQLServerException
SQLTimeoutException
-
execute
public boolean execute() throws SQLServerException, SQLTimeoutException
- Specified by:
execute
in interfacePreparedStatement
- Throws:
SQLServerException
SQLTimeoutException
-
getMetaData
public final ResultSetMetaData getMetaData() throws SQLServerException, SQLTimeoutException
- Specified by:
getMetaData
in interfacePreparedStatement
- Throws:
SQLServerException
SQLTimeoutException
-
setAsciiStream
public final void setAsciiStream(int parameterIndex, InputStream x) throws SQLException
- Specified by:
setAsciiStream
in interfacePreparedStatement
- Throws:
SQLException
-
setAsciiStream
public final void setAsciiStream(int n, InputStream x, int length) throws SQLServerException
- Specified by:
setAsciiStream
in interfacePreparedStatement
- Throws:
SQLServerException
-
setAsciiStream
public final void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException
- Specified by:
setAsciiStream
in interfacePreparedStatement
- Throws:
SQLException
-
setBigDecimal
public final void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLServerException
- Specified by:
setBigDecimal
in interfacePreparedStatement
- Throws:
SQLServerException
-
setBigDecimal
public final void setBigDecimal(int parameterIndex, BigDecimal x, int precision, int scale) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the givenjava.math.BigDecimal
value. The driver converts this to an SQLNUMERIC
value when it sends it to the database.- Specified by:
setBigDecimal
in interfaceISQLServerPreparedStatement
- Parameters:
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valueprecision
- the precision of the columnscale
- the scale of the column- Throws:
SQLServerException
- when an error occurs
-
setBigDecimal
public final void setBigDecimal(int parameterIndex, BigDecimal x, int precision, int scale, boolean forceEncrypt) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the givenjava.math.BigDecimal
value. The driver converts this to an SQLNUMERIC
value when it sends it to the database.- Specified by:
setBigDecimal
in interfaceISQLServerPreparedStatement
- Parameters:
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valueprecision
- the precision of the columnscale
- the scale of the columnforceEncrypt
- 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, BigDecimal x) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the givenjava.math.BigDecimal
value. The driver converts this to an SQLNUMERIC
value when it sends it to the database.- Specified by:
setMoney
in interfaceISQLServerPreparedStatement
- 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, BigDecimal x, boolean forceEncrypt) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the givenjava.math.BigDecimal
value. The driver converts this to an SQLNUMERIC
value when it sends it to the database.- Specified by:
setMoney
in interfaceISQLServerPreparedStatement
- Parameters:
n
- the first parameter is 1, the second is 2, ...x
- the parameter valueforceEncrypt
- 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, BigDecimal x) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the givenjava.math.BigDecimal
value. The driver converts this to an SQLNUMERIC
value when it sends it to the database.- Specified by:
setSmallMoney
in interfaceISQLServerPreparedStatement
- 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, BigDecimal x, boolean forceEncrypt) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the givenjava.math.BigDecimal
value. The driver converts this to an SQLNUMERIC
value when it sends it to the database.- Specified by:
setSmallMoney
in interfaceISQLServerPreparedStatement
- Parameters:
n
- the first parameter is 1, the second is 2, ...x
- the parameter valueforceEncrypt
- 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, InputStream x) throws SQLException
- Specified by:
setBinaryStream
in interfacePreparedStatement
- Throws:
SQLException
-
setBinaryStream
public final void setBinaryStream(int n, InputStream x, int length) throws SQLServerException
- Specified by:
setBinaryStream
in interfacePreparedStatement
- Throws:
SQLServerException
-
setBinaryStream
public final void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException
- Specified by:
setBinaryStream
in interfacePreparedStatement
- Throws:
SQLException
-
setBoolean
public final void setBoolean(int n, boolean x) throws SQLServerException
- Specified by:
setBoolean
in interfacePreparedStatement
- Throws:
SQLServerException
-
setBoolean
public final void setBoolean(int n, boolean x, boolean forceEncrypt) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the given Javaboolean
value. The driver converts this to an SQLBIT
orBOOLEAN
value when it sends it to the database.- Specified by:
setBoolean
in interfaceISQLServerPreparedStatement
- Parameters:
n
- the first parameter is 1, the second is 2, ...x
- the parameter valueforceEncrypt
- 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 interfacePreparedStatement
- Throws:
SQLServerException
-
setByte
public final void setByte(int n, byte x, boolean forceEncrypt) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the given Javabyte
value. The driver converts this to an SQLTINYINT
value when it sends it to the database.- Specified by:
setByte
in interfaceISQLServerPreparedStatement
- Parameters:
n
- the first parameter is 1, the second is 2, ...x
- the parameter valueforceEncrypt
- 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 interfacePreparedStatement
- Throws:
SQLServerException
-
setBytes
public final void setBytes(int n, byte[] x, boolean forceEncrypt) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the given Java array of bytes. The driver converts this to an SQLVARBINARY
orLONGVARBINARY
(depending on the argument's size relative to the driver's limits onVARBINARY
values) when it sends it to the database.- Specified by:
setBytes
in interfaceISQLServerPreparedStatement
- Parameters:
n
- the first parameter is 1, the second is 2, ...x
- the parameter valueforceEncrypt
- 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, String guid) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the given String. The driver converts this to an SQLGUID
- Specified by:
setUniqueIdentifier
in interfaceISQLServerPreparedStatement
- 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, String guid, boolean forceEncrypt) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the given String. The driver converts this to an SQLGUID
- Specified by:
setUniqueIdentifier
in interfaceISQLServerPreparedStatement
- Parameters:
index
- the first parameter is 1, the second is 2, ...guid
- string representation of the uniqueIdentifier valueforceEncrypt
- 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 interfacePreparedStatement
- Throws:
SQLServerException
-
setDouble
public final void setDouble(int n, double x, boolean forceEncrypt) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the given Javadouble
value. The driver converts this to an SQLDOUBLE
value when it sends it to the database.- Specified by:
setDouble
in interfaceISQLServerPreparedStatement
- Parameters:
n
- the first parameter is 1, the second is 2, ...x
- the parameter valueforceEncrypt
- 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 interfacePreparedStatement
- Throws:
SQLServerException
-
setFloat
public final void setFloat(int n, float x, boolean forceEncrypt) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the given Javafloat
value. The driver converts this to an SQLREAL
value when it sends it to the database.- Specified by:
setFloat
in interfaceISQLServerPreparedStatement
- Parameters:
n
- the first parameter is 1, the second is 2, ...x
- the parameter valueforceEncrypt
- 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
-
setGeometry
public final void setGeometry(int n, Geometry x) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the givenmicrosoft.sql.Geometry
Class object. The driver converts this to an SQLREAL
value when it sends it to the database.- Specified by:
setGeometry
in interfaceISQLServerPreparedStatement
- Parameters:
n
- the first parameter is 1, the second is 2, ...x
- the parameter value- Throws:
SQLServerException
- when an error occurs
-
setGeography
public final void setGeography(int n, Geography x) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the givenmicrosoft.sql.Geography
Class object. The driver converts this to an SQLREAL
value when it sends it to the database.- Specified by:
setGeography
in interfaceISQLServerPreparedStatement
- Parameters:
n
- the first parameter is 1, the second is 2, ...x
- the parameter value- Throws:
SQLServerException
- when an error occurs
-
setInt
public final void setInt(int n, int value) throws SQLServerException
- Specified by:
setInt
in interfacePreparedStatement
- Throws:
SQLServerException
-
setInt
public final void setInt(int n, int value, boolean forceEncrypt) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the given Javaint
value. The driver converts this to an SQLINTEGER
value when it sends it to the database.- Specified by:
setInt
in interfaceISQLServerPreparedStatement
- Parameters:
n
- the first parameter is 1, the second is 2, ...value
- the parameter valueforceEncrypt
- 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 interfacePreparedStatement
- Throws:
SQLServerException
-
setLong
public final void setLong(int n, long x, boolean forceEncrypt) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the given Javalong
value. The driver converts this to an SQLBIGINT
value when it sends it to the database.- Specified by:
setLong
in interfaceISQLServerPreparedStatement
- Parameters:
n
- the first parameter is 1, the second is 2, ...x
- the parameter valueforceEncrypt
- 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 interfacePreparedStatement
- Throws:
SQLServerException
-
setObject
public final void setObject(int index, Object obj) throws SQLServerException
- Specified by:
setObject
in interfacePreparedStatement
- Throws:
SQLServerException
-
setObject
public final void setObject(int n, Object obj, int jdbcType) throws SQLServerException
- Specified by:
setObject
in interfacePreparedStatement
- Throws:
SQLServerException
-
setObject
public final void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLServerException
- Specified by:
setObject
in interfacePreparedStatement
- Throws:
SQLServerException
-
setObject
public final void setObject(int parameterIndex, Object x, int targetSqlType, Integer precision, int scale) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
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 methodSQLData.writeSQL
to write it to the SQL data stream. If, on the other hand, the object is of a class implementingRef
,Blob
,Clob
,NClob
,Struct
,java.net.URL
, orArray
, 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.
- Specified by:
setObject
in interfaceISQLServerPreparedStatement
- Parameters:
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the object containing the input parameter valuetargetSqlType
- 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 columnscale
- scale of the column- Throws:
SQLServerException
- when an error occurs
-
setObject
public final void setObject(int parameterIndex, Object x, int targetSqlType, Integer precision, int scale, boolean forceEncrypt) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
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 methodSQLData.writeSQL
to write it to the SQL data stream. If, on the other hand, the object is of a class implementingRef
,Blob
,Clob
,NClob
,Struct
,java.net.URL
, orArray
, 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.
- Specified by:
setObject
in interfaceISQLServerPreparedStatement
- Parameters:
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the object containing the input parameter valuetargetSqlType
- 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 columnscale
- scale of the columnforceEncrypt
- 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
-
setObject
public final void setObject(int index, Object obj, SQLType jdbcType) throws SQLServerException
- Specified by:
setObject
in interfacePreparedStatement
- Throws:
SQLServerException
-
setObject
public final void setObject(int parameterIndex, Object x, SQLType targetSqlType, int scaleOrLength) throws SQLServerException
- Specified by:
setObject
in interfacePreparedStatement
- Throws:
SQLServerException
-
setObject
public final void setObject(int parameterIndex, Object x, SQLType targetSqlType, Integer precision, Integer scale) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the value of the designated parameter with the given object. This method is similar toPreparedStatement.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 interfaceISQLServerPreparedStatement
- Parameters:
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the object containing the input parameter valuetargetSqlType
- the SQL type to be sent to the databaseprecision
- the precision of the columnscale
- 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 closedPreparedStatement
-
setObject
public final void setObject(int parameterIndex, Object x, SQLType targetSqlType, Integer precision, Integer scale, boolean forceEncrypt) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the value of the designated parameter with the given object. This method is similar toPreparedStatement.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 interfaceISQLServerPreparedStatement
- Parameters:
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the object containing the input parameter valuetargetSqlType
- the SQL type to be sent to the databaseprecision
- the precision of the columnscale
- the scale of the columnforceEncrypt
- 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 closedPreparedStatement
-
setShort
public final void setShort(int index, short x) throws SQLServerException
- Specified by:
setShort
in interfacePreparedStatement
- Throws:
SQLServerException
-
setShort
public final void setShort(int index, short x, boolean forceEncrypt) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the given Javashort
value. The driver converts this to an SQLSMALLINT
value when it sends it to the database.- Specified by:
setShort
in interfaceISQLServerPreparedStatement
- Parameters:
index
- the first parameter is 1, the second is 2, ...x
- the parameter valueforceEncrypt
- 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, String str) throws SQLServerException
- Specified by:
setString
in interfacePreparedStatement
- Throws:
SQLServerException
-
setString
public final void setString(int index, String str, boolean forceEncrypt) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the given JavaString
value. The driver converts this to an SQLVARCHAR
orLONGVARCHAR
value (depending on the argument's size relative to the driver's limits onVARCHAR
values) when it sends it to the database.- Specified by:
setString
in interfaceISQLServerPreparedStatement
- Parameters:
index
- the first parameter is 1, the second is 2, ...str
- the parameter valueforceEncrypt
- 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, String value) throws SQLException
- Specified by:
setNString
in interfacePreparedStatement
- Throws:
SQLException
-
setNString
public final void setNString(int parameterIndex, String value, boolean forceEncrypt) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the givenString
object. The driver converts this to a SQLNCHAR
orNVARCHAR
orLONGNVARCHAR
value (depending on the argument's size relative to the driver's limits onNVARCHAR
values) when it sends it to the database.- Specified by:
setNString
in interfaceISQLServerPreparedStatement
- Parameters:
parameterIndex
- of the first parameter is 1, the second is 2, ...value
- the parameter valueforceEncrypt
- 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, Time x) throws SQLServerException
- Specified by:
setTime
in interfacePreparedStatement
- Throws:
SQLServerException
-
setTime
public final void setTime(int n, Time x, int scale) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the givenjava.sql.Time
value.- Specified by:
setTime
in interfaceISQLServerPreparedStatement
- Parameters:
n
- the first parameter is 1, the second is 2, ...x
- the parameter valuescale
- the scale of the column- Throws:
SQLServerException
- when an error occurs
-
setTime
public final void setTime(int n, Time x, int scale, boolean forceEncrypt) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the givenjava.sql.Time
value.- Specified by:
setTime
in interfaceISQLServerPreparedStatement
- Parameters:
n
- the first parameter is 1, the second is 2, ...x
- the parameter valuescale
- the scale of the columnforceEncrypt
- 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, Timestamp x) throws SQLServerException
- Specified by:
setTimestamp
in interfacePreparedStatement
- Throws:
SQLServerException
-
setTimestamp
public final void setTimestamp(int n, Timestamp x, int scale) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the givenjava.sql.Timestamp
value.- Specified by:
setTimestamp
in interfaceISQLServerPreparedStatement
- Parameters:
n
- the first parameter is 1, the second is 2, ...x
- the parameter valuescale
- the scale of the column- Throws:
SQLServerException
- when an error occurs
-
setTimestamp
public final void setTimestamp(int n, Timestamp x, int scale, boolean forceEncrypt) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the givenjava.sql.Timestamp
value.- Specified by:
setTimestamp
in interfaceISQLServerPreparedStatement
- Parameters:
n
- the first parameter is 1, the second is 2, ...x
- the parameter valuescale
- the scale of the columnforceEncrypt
- 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 SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the givenmicrosoft.sql.DateTimeOffset
value.- Specified by:
setDateTimeOffset
in interfaceISQLServerPreparedStatement
- Parameters:
n
- the first parameter is 1, the second is 2, ...x
- the parameter value- 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 closedPreparedStatement
-
setDateTimeOffset
public final void setDateTimeOffset(int n, DateTimeOffset x, int scale) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the givenmicrosoft.sql.DatetimeOffset
value.- Specified by:
setDateTimeOffset
in interfaceISQLServerPreparedStatement
- Parameters:
n
- the first parameter is 1, the second is 2, ...x
- the parameter valuescale
- the scale of the column- Throws:
SQLServerException
- when an error occurs
-
setDateTimeOffset
public final void setDateTimeOffset(int n, DateTimeOffset x, int scale, boolean forceEncrypt) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the givenmicrosoft.sql.DatetimeOffset
value.- Specified by:
setDateTimeOffset
in interfaceISQLServerPreparedStatement
- Parameters:
n
- the first parameter is 1, the second is 2, ...x
- the parameter valuescale
- the scale of the columnforceEncrypt
- 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
-
setDate
public final void setDate(int n, Date x) throws SQLServerException
- Specified by:
setDate
in interfacePreparedStatement
- Throws:
SQLServerException
-
setDateTime
public final void setDateTime(int n, Timestamp x) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the givenjava.sql.Timestamp
value.- Specified by:
setDateTime
in interfaceISQLServerPreparedStatement
- 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, Timestamp x, boolean forceEncrypt) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the givenjava.sql.Timestamp
value.- Specified by:
setDateTime
in interfaceISQLServerPreparedStatement
- Parameters:
n
- the first parameter is 1, the second is 2, ...x
- the parameter valueforceEncrypt
- 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, Timestamp x) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the givenjava.sql.Timestamp
value.- Specified by:
setSmallDateTime
in interfaceISQLServerPreparedStatement
- 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, Timestamp x, boolean forceEncrypt) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the givenjava.sql.Timestamp
value.- Specified by:
setSmallDateTime
in interfaceISQLServerPreparedStatement
- Parameters:
n
- the first parameter is 1, the second is 2, ...x
- the parameter valueforceEncrypt
- 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, String tvpName, SQLServerDataTable tvpDataTable) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the data table to populates a table valued parameter.- Specified by:
setStructured
in interfaceISQLServerPreparedStatement
- Parameters:
n
- the first parameter is 1, the second is 2, ...tvpName
- the name of the table valued parametertvpDataTable
- the source datatable object- Throws:
SQLServerException
- when an error occurs
-
setStructured
public final void setStructured(int n, String tvpName, ResultSet tvpResultSet) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the result set to populate a table-valued parameter.- Specified by:
setStructured
in interfaceISQLServerPreparedStatement
- Parameters:
n
- the first parameter is 1, the second is 2, ...tvpName
- the name of the table valued parametertvpResultSet
- the source resultset object- Throws:
SQLServerException
- when an error occurs
-
setStructured
public final void setStructured(int n, String tvpName, ISQLServerDataRecord tvpBulkRecord) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the server bulk record to populate a table valued parameter.- Specified by:
setStructured
in interfaceISQLServerPreparedStatement
- Parameters:
n
- the first parameter is 1, the second is 2, ...tvpName
- the name of the table valued parametertvpBulkRecord
- an ISQLServerDataRecord object- Throws:
SQLServerException
- when an error occurs
-
setUnicodeStream
@Deprecated public final void setUnicodeStream(int n, InputStream x, int length) throws SQLException
Deprecated.- Specified by:
setUnicodeStream
in interfacePreparedStatement
- Throws:
SQLException
-
addBatch
public final void addBatch() throws SQLServerException
- Specified by:
addBatch
in interfacePreparedStatement
- Throws:
SQLServerException
-
clearBatch
public final void clearBatch() throws SQLServerException
- Specified by:
clearBatch
in interfaceStatement
- Overrides:
clearBatch
in classSQLServerStatement
- Throws:
SQLServerException
-
executeBatch
public int[] executeBatch() throws SQLServerException, BatchUpdateException, SQLTimeoutException
Description copied from class:SQLServerStatement
Sends a batch of statements to the database.- Specified by:
executeBatch
in interfaceStatement
- Overrides:
executeBatch
in classSQLServerStatement
- Throws:
SQLServerException
BatchUpdateException
SQLTimeoutException
-
executeLargeBatch
public long[] executeLargeBatch() throws SQLServerException, BatchUpdateException, SQLTimeoutException
- Specified by:
executeLargeBatch
in interfaceStatement
- Overrides:
executeLargeBatch
in classSQLServerStatement
- Throws:
SQLServerException
BatchUpdateException
SQLTimeoutException
-
setUseFmtOnly
public final void setUseFmtOnly(boolean useFmtOnly) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Specifies the flag to use FMTONLY for parameter metadata queries.- Specified by:
setUseFmtOnly
in interfaceISQLServerPreparedStatement
- Parameters:
useFmtOnly
- boolean value for 'useFmtOnly'.- Throws:
SQLServerException
- when the connection is closed.
-
getUseFmtOnly
public final boolean getUseFmtOnly() throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Returns the current flag value for useFmtOnly.- Specified by:
getUseFmtOnly
in interfaceISQLServerPreparedStatement
- Returns:
- 'useFmtOnly' property value.
- Throws:
SQLServerException
- when the connection is closed.
-
setCharacterStream
public final void setCharacterStream(int parameterIndex, Reader reader) throws SQLException
- Specified by:
setCharacterStream
in interfacePreparedStatement
- Throws:
SQLException
-
setCharacterStream
public final void setCharacterStream(int n, Reader reader, int length) throws SQLServerException
- Specified by:
setCharacterStream
in interfacePreparedStatement
- Throws:
SQLServerException
-
setCharacterStream
public final void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException
- Specified by:
setCharacterStream
in interfacePreparedStatement
- Throws:
SQLException
-
setNCharacterStream
public final void setNCharacterStream(int parameterIndex, Reader value) throws SQLException
- Specified by:
setNCharacterStream
in interfacePreparedStatement
- Throws:
SQLException
-
setNCharacterStream
public final void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException
- Specified by:
setNCharacterStream
in interfacePreparedStatement
- Throws:
SQLException
-
setRef
public final void setRef(int i, Ref x) throws SQLException
- Specified by:
setRef
in interfacePreparedStatement
- Throws:
SQLException
-
setBlob
public final void setBlob(int i, Blob x) throws SQLException
- Specified by:
setBlob
in interfacePreparedStatement
- Throws:
SQLException
-
setBlob
public final void setBlob(int parameterIndex, InputStream inputStream) throws SQLException
- Specified by:
setBlob
in interfacePreparedStatement
- Throws:
SQLException
-
setBlob
public final void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException
- Specified by:
setBlob
in interfacePreparedStatement
- Throws:
SQLException
-
setClob
public final void setClob(int parameterIndex, Clob clobValue) throws SQLException
- Specified by:
setClob
in interfacePreparedStatement
- Throws:
SQLException
-
setClob
public final void setClob(int parameterIndex, Reader reader) throws SQLException
- Specified by:
setClob
in interfacePreparedStatement
- Throws:
SQLException
-
setClob
public final void setClob(int parameterIndex, Reader reader, long length) throws SQLException
- Specified by:
setClob
in interfacePreparedStatement
- Throws:
SQLException
-
setNClob
public final void setNClob(int parameterIndex, NClob value) throws SQLException
- Specified by:
setNClob
in interfacePreparedStatement
- Throws:
SQLException
-
setNClob
public final void setNClob(int parameterIndex, Reader reader) throws SQLException
- Specified by:
setNClob
in interfacePreparedStatement
- Throws:
SQLException
-
setNClob
public final void setNClob(int parameterIndex, Reader reader, long length) throws SQLException
- Specified by:
setNClob
in interfacePreparedStatement
- Throws:
SQLException
-
setArray
public final void setArray(int i, Array x) throws SQLException
- Specified by:
setArray
in interfacePreparedStatement
- Throws:
SQLException
-
setDate
public final void setDate(int n, Date x, Calendar cal) throws SQLServerException
- Specified by:
setDate
in interfacePreparedStatement
- Throws:
SQLServerException
-
setDate
public final void setDate(int n, Date x, Calendar cal, boolean forceEncrypt) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the givenjava.sql.Date
value, using the givenCalendar
object. The driver uses theCalendar
object to construct an SQLDATE
value, which the driver then sends to the database. With aCalendar
object, the driver can calculate the date taking into account a custom timezone. If noCalendar
object is specified, the driver uses the default timezone, which is that of the virtual machine running the application.- Specified by:
setDate
in interfaceISQLServerPreparedStatement
- Parameters:
n
- the first parameter is 1, the second is 2, ...x
- the parameter valuecal
- theCalendar
object the driver will use to construct the dateforceEncrypt
- 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, Time x, Calendar cal) throws SQLServerException
- Specified by:
setTime
in interfacePreparedStatement
- Throws:
SQLServerException
-
setTime
public final void setTime(int n, Time x, Calendar cal, boolean forceEncrypt) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the givenjava.sql.Time
value. The driver converts this to an SQLTIME
value when it sends it to the database.- Specified by:
setTime
in interfaceISQLServerPreparedStatement
- Parameters:
n
- the first parameter is 1, the second is 2, ...x
- the parameter valuecal
- theCalendar
object the driver will use to construct the dateforceEncrypt
- 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, Timestamp x, Calendar cal) throws SQLServerException
- Specified by:
setTimestamp
in interfacePreparedStatement
- Throws:
SQLServerException
-
setTimestamp
public final void setTimestamp(int n, Timestamp x, Calendar cal, boolean forceEncrypt) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Sets the designated parameter to the givenjava.sql.Timestamp
value. The driver converts this to an SQLTIMESTAMP
value when it sends it to the database.- Specified by:
setTimestamp
in interfaceISQLServerPreparedStatement
- Parameters:
n
- the first parameter is 1, the second is 2, ...x
- the parameter valuecal
- theCalendar
object the driver will use to construct the dateforceEncrypt
- 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, String typeName) throws SQLServerException
- Specified by:
setNull
in interfacePreparedStatement
- Throws:
SQLServerException
-
getParameterMetaData
public final ParameterMetaData getParameterMetaData(boolean forceRefresh) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatement
Returns parameter metadata for the prepared statement.- Specified by:
getParameterMetaData
in interfaceISQLServerPreparedStatement
- 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 ParameterMetaData getParameterMetaData() throws SQLServerException
- Specified by:
getParameterMetaData
in interfacePreparedStatement
- Throws:
SQLServerException
-
setURL
public final void setURL(int parameterIndex, URL x) throws SQLException
- Specified by:
setURL
in interfacePreparedStatement
- Throws:
SQLException
-
setRowId
public final void setRowId(int parameterIndex, RowId x) throws SQLException
- Specified by:
setRowId
in interfacePreparedStatement
- Throws:
SQLException
-
setSQLXML
public final void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException
- Specified by:
setSQLXML
in interfacePreparedStatement
- Throws:
SQLException
-
executeUpdate
public final int executeUpdate(String sql) throws SQLServerException
- Specified by:
executeUpdate
in interfaceStatement
- Overrides:
executeUpdate
in classSQLServerStatement
- Throws:
SQLServerException
-
execute
public final boolean execute(String sql) throws SQLServerException
- Specified by:
execute
in interfaceStatement
- Overrides:
execute
in classSQLServerStatement
- Throws:
SQLServerException
-
executeQuery
public final ResultSet executeQuery(String sql) throws SQLServerException
- Specified by:
executeQuery
in interfaceStatement
- Overrides:
executeQuery
in classSQLServerStatement
- Throws:
SQLServerException
-
addBatch
public void addBatch(String sql) throws SQLServerException
- Specified by:
addBatch
in interfaceStatement
- Overrides:
addBatch
in classSQLServerStatement
- Throws:
SQLServerException
-
-