Interface ISQLServerPreparedStatement
- All Superinterfaces:
AutoCloseable
,ISQLServerStatement
,PreparedStatement
,Serializable
,Statement
,Wrapper
- All Known Subinterfaces:
ISQLServerCallableStatement
- All Known Implementing Classes:
SQLServerCallableStatement
,SQLServerPreparedStatement
SQLServerPreparedStatement
class.-
Field Summary
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
Modifier and TypeMethodDescriptiongetParameterMetaData
(boolean forceRefresh) Returns parameter metadata for the prepared statement.int
The server handle for this prepared statement.boolean
Returns the current flag value for useFmtOnly.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
setBoolean
(int parameterIndex, boolean x, boolean forceEncrypt) Sets the designated parameter to the given Javaboolean
value.void
setByte
(int parameterIndex, byte x, boolean forceEncrypt) Sets the designated parameter to the given Javabyte
value.void
setBytes
(int parameterIndex, byte[] x, boolean forceEncrypt) Sets the designated parameter to the given Java array of bytes.void
Sets the designated parameter to the givenjava.sql.Date
value, using the givenCalendar
object.void
setDateTime
(int parameterIndex, Timestamp x) Sets the designated parameter to the givenjava.sql.Timestamp
value.void
setDateTime
(int parameterIndex, Timestamp x, boolean forceEncrypt) Sets the designated parameter to the givenjava.sql.Timestamp
value.void
setDateTimeOffset
(int parameterIndex, DateTimeOffset x) Sets the designated parameter to the givenmicrosoft.sql.DateTimeOffset
value.void
setDateTimeOffset
(int parameterIndex, DateTimeOffset x, int scale) Sets the designated parameter to the givenmicrosoft.sql.DatetimeOffset
value.void
setDateTimeOffset
(int parameterIndex, DateTimeOffset x, int scale, boolean forceEncrypt) Sets the designated parameter to the givenmicrosoft.sql.DatetimeOffset
value.void
setDouble
(int parameterIndex, double x, boolean forceEncrypt) Sets the designated parameter to the given Javadouble
value.void
setFloat
(int parameterIndex, float x, boolean forceEncrypt) Sets the designated parameter to the given Javafloat
value.void
setGeography
(int parameterIndex, Geography x) Sets the designated parameter to the givenmicrosoft.sql.Geography
Class object.void
setGeometry
(int parameterIndex, Geometry x) Sets the designated parameter to the givenmicrosoft.sql.Geometry
Class object.void
setInt
(int parameterIndex, int value, boolean forceEncrypt) Sets the designated parameter to the given Javaint
value.void
setLong
(int parameterIndex, long x, boolean forceEncrypt) Sets the designated parameter to the given Javalong
value.void
setMoney
(int parameterIndex, BigDecimal x) Sets the designated parameter to the givenjava.math.BigDecimal
value.void
setMoney
(int parameterIndex, BigDecimal x, boolean forceEncrypt) Sets the designated parameter to the givenjava.math.BigDecimal
value.void
setNString
(int parameterIndex, String value, boolean forceEncrypt) Sets the designated parameter to the givenString
object.void
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
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
setShort
(int parameterIndex, short x, boolean forceEncrypt) Sets the designated parameter to the given Javashort
value.void
setSmallDateTime
(int parameterIndex, Timestamp x) Sets the designated parameter to the givenjava.sql.Timestamp
value.void
setSmallDateTime
(int parameterIndex, Timestamp x, boolean forceEncrypt) Sets the designated parameter to the givenjava.sql.Timestamp
value.void
setSmallMoney
(int parameterIndex, BigDecimal x) Sets the designated parameter to the givenjava.math.BigDecimal
value.void
setSmallMoney
(int parameterIndex, BigDecimal x, boolean forceEncrypt) Sets the designated parameter to the givenjava.math.BigDecimal
value.void
Sets the designated parameter to the given JavaString
value.void
setStructured
(int parameterIndex, String tvpName, ISQLServerDataRecord tvpBulkRecord) Sets the server bulk record to populate a table valued parameter.void
setStructured
(int parameterIndex, String tvpName, SQLServerDataTable tvpDataTable) Sets the data table to populates a table valued parameter.void
setStructured
(int parameterIndex, String tvpName, ResultSet tvpResultSet) Sets the result set to populate a table-valued parameter.void
Sets the designated parameter to the givenjava.sql.Time
value.void
Sets the designated parameter to the givenjava.sql.Time
value.void
Sets the designated parameter to the givenjava.sql.Time
value.void
setTimestamp
(int parameterIndex, Timestamp x, int scale) Sets the designated parameter to the givenjava.sql.Timestamp
value.void
setTimestamp
(int parameterIndex, Timestamp x, int scale, boolean forceEncrypt) Sets the designated parameter to the givenjava.sql.Timestamp
value.void
setTimestamp
(int parameterIndex, Timestamp x, Calendar cal, boolean forceEncrypt) Sets the designated parameter to the givenjava.sql.Timestamp
value.void
setUniqueIdentifier
(int parameterIndex, String guid) Sets the designated parameter to the given String.void
setUniqueIdentifier
(int parameterIndex, String guid, boolean forceEncrypt) Sets the designated parameter to the given String.void
setUseFmtOnly
(boolean useFmtOnly) Specifies the flag to use FMTONLY for parameter metadata queries.Methods inherited from interface com.microsoft.sqlserver.jdbc.ISQLServerStatement
getCancelQueryTimeout, getResponseBuffering, setCancelQueryTimeout, setResponseBuffering
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, setObject, setObject, setRef, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL
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 Details
-
setDateTimeOffset
Sets the designated parameter to the givenmicrosoft.sql.DateTimeOffset
value.- Parameters:
parameterIndex
- 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
-
setObject
void setObject(int parameterIndex, Object x, SQLType targetSqlType, Integer precision, Integer scale) throws SQLServerException 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
- 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
void setObject(int parameterIndex, Object x, SQLType targetSqlType, Integer precision, Integer scale, boolean forceEncrypt) throws SQLServerException 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
- 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
-
getPreparedStatementHandle
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
-
setBigDecimal
void setBigDecimal(int parameterIndex, BigDecimal x, int precision, int scale) throws SQLServerException 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.- 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
void setBigDecimal(int parameterIndex, BigDecimal x, int precision, int scale, boolean forceEncrypt) throws SQLServerException 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.- 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
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.- Parameters:
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter value- Throws:
SQLServerException
- when an error occurs
-
setMoney
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.- Parameters:
parameterIndex
- 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
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.- Parameters:
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter value- Throws:
SQLServerException
- when an error occurs
-
setSmallMoney
void setSmallMoney(int parameterIndex, BigDecimal x, boolean forceEncrypt) throws SQLServerException 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.- Parameters:
parameterIndex
- 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
-
setBoolean
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.- Parameters:
parameterIndex
- 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
Sets the designated parameter to the given Javabyte
value. The driver converts this to an SQLTINYINT
value when it sends it to the database.- Parameters:
parameterIndex
- 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
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.- Parameters:
parameterIndex
- 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
Sets the designated parameter to the given String. The driver converts this to an SQLGUID
- Parameters:
parameterIndex
- the first parameter is 1, the second is 2, ...guid
- string representation of the uniqueIdentifier value- Throws:
SQLServerException
- when an error occurs
-
setUniqueIdentifier
void setUniqueIdentifier(int parameterIndex, String guid, boolean forceEncrypt) throws SQLServerException Sets the designated parameter to the given String. The driver converts this to an SQLGUID
- Parameters:
parameterIndex
- 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
Sets the designated parameter to the given Javadouble
value. The driver converts this to an SQLDOUBLE
value when it sends it to the database.- Parameters:
parameterIndex
- 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
Sets the designated parameter to the given Javafloat
value. The driver converts this to an SQLREAL
value when it sends it to the database.- Parameters:
parameterIndex
- 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
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.- Parameters:
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter value- Throws:
SQLServerException
- when an error occurs
-
setGeography
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.- Parameters:
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter value- Throws:
SQLServerException
- when an error occurs
-
setInt
Sets the designated parameter to the given Javaint
value. The driver converts this to an SQLINTEGER
value when it sends it to the database.- Parameters:
parameterIndex
- 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
Sets the designated parameter to the given Javalong
value. The driver converts this to an SQLBIGINT
value when it sends it to the database.- Parameters:
parameterIndex
- 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
-
setObject
void setObject(int parameterIndex, Object x, int targetSqlType, 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 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.
- 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
void setObject(int parameterIndex, Object x, int targetSqlType, 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 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.
- 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
-
setShort
Sets the designated parameter to the given Javashort
value. The driver converts this to an SQLSMALLINT
value when it sends it to the database.- Parameters:
parameterIndex
- 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
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.- Parameters:
parameterIndex
- 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
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.- 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
Sets the designated parameter to the givenjava.sql.Time
value.- Parameters:
parameterIndex
- 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
Sets the designated parameter to the givenjava.sql.Time
value.- Parameters:
parameterIndex
- 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
Sets the designated parameter to the givenjava.sql.Timestamp
value.- Parameters:
parameterIndex
- 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
void setTimestamp(int parameterIndex, Timestamp x, int scale, boolean forceEncrypt) throws SQLServerException Sets the designated parameter to the givenjava.sql.Timestamp
value.- Parameters:
parameterIndex
- 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
Sets the designated parameter to the givenmicrosoft.sql.DatetimeOffset
value.- Parameters:
parameterIndex
- 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
void setDateTimeOffset(int parameterIndex, DateTimeOffset x, int scale, boolean forceEncrypt) throws SQLServerException Sets the designated parameter to the givenmicrosoft.sql.DatetimeOffset
value.- Parameters:
parameterIndex
- 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
-
setDateTime
Sets the designated parameter to the givenjava.sql.Timestamp
value.- Parameters:
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter value- Throws:
SQLServerException
- when an error occurs
-
setDateTime
Sets the designated parameter to the givenjava.sql.Timestamp
value.- Parameters:
parameterIndex
- 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
Sets the designated parameter to the givenjava.sql.Timestamp
value.- Parameters:
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter value- Throws:
SQLServerException
- when an error occurs
-
setSmallDateTime
void setSmallDateTime(int parameterIndex, Timestamp x, boolean forceEncrypt) throws SQLServerException Sets the designated parameter to the givenjava.sql.Timestamp
value.- Parameters:
parameterIndex
- 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
void setStructured(int parameterIndex, String tvpName, SQLServerDataTable tvpDataTable) throws SQLServerException Sets the data table to populates a table valued parameter.- Parameters:
parameterIndex
- 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
void setStructured(int parameterIndex, String tvpName, ResultSet tvpResultSet) throws SQLServerException Sets the result set to populate a table-valued parameter.- Parameters:
parameterIndex
- 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
void setStructured(int parameterIndex, String tvpName, ISQLServerDataRecord tvpBulkRecord) throws SQLServerException Sets the server bulk record to populate a table valued parameter.- Parameters:
parameterIndex
- 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
-
setDate
void setDate(int parameterIndex, Date x, Calendar cal, boolean forceEncrypt) throws SQLServerException 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.- Parameters:
parameterIndex
- 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
void setTime(int parameterIndex, Time x, Calendar cal, boolean forceEncrypt) throws SQLServerException 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.- Parameters:
parameterIndex
- 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
void setTimestamp(int parameterIndex, Timestamp x, Calendar cal, boolean forceEncrypt) throws SQLServerException 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.- Parameters:
parameterIndex
- 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
-
getParameterMetaData
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
-
getUseFmtOnly
Returns the current flag value for useFmtOnly.- Returns:
- 'useFmtOnly' property value.
- Throws:
SQLServerException
- when the connection is closed.
-
setUseFmtOnly
Specifies the flag to use FMTONLY for parameter metadata queries.- Parameters:
useFmtOnly
- boolean value for 'useFmtOnly'.- Throws:
SQLServerException
- when the connection is closed.
-