Interface ISQLServerPreparedStatement
-
- All Superinterfaces:
AutoCloseable,ISQLServerStatement,PreparedStatement,Serializable,Statement,Wrapper
- All Known Subinterfaces:
ISQLServerCallableStatement
- All Known Implementing Classes:
SQLServerCallableStatement,SQLServerPreparedStatement
public interface ISQLServerPreparedStatement extends PreparedStatement, ISQLServerStatement
Provides an interface to theSQLServerPreparedStatementclass.
-
-
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ParameterMetaDatagetParameterMetaData(boolean forceRefresh)Returns parameter metadata for the prepared statement.intgetPreparedStatementHandle()The server handle for this prepared statement.booleangetUseFmtOnly()Returns the current flag value for useFmtOnly.voidsetBigDecimal(int parameterIndex, BigDecimal x, int precision, int scale)Sets the designated parameter to the givenjava.math.BigDecimalvalue.voidsetBigDecimal(int parameterIndex, BigDecimal x, int precision, int scale, boolean forceEncrypt)Sets the designated parameter to the givenjava.math.BigDecimalvalue.voidsetBoolean(int parameterIndex, boolean x, boolean forceEncrypt)Sets the designated parameter to the given Javabooleanvalue.voidsetByte(int parameterIndex, byte x, boolean forceEncrypt)Sets the designated parameter to the given Javabytevalue.voidsetBytes(int parameterIndex, byte[] x, boolean forceEncrypt)Sets the designated parameter to the given Java array of bytes.voidsetDate(int parameterIndex, Date x, Calendar cal, boolean forceEncrypt)Sets the designated parameter to the givenjava.sql.Datevalue, using the givenCalendarobject.voidsetDateTime(int parameterIndex, Timestamp x)Sets the designated parameter to the givenjava.sql.Timestampvalue.voidsetDateTime(int parameterIndex, Timestamp x, boolean forceEncrypt)Sets the designated parameter to the givenjava.sql.Timestampvalue.voidsetDateTimeOffset(int parameterIndex, DateTimeOffset x)Sets the designated parameter to the givenmicrosoft.sql.DateTimeOffsetvalue.voidsetDateTimeOffset(int parameterIndex, DateTimeOffset x, int scale)Sets the designated parameter to the givenmicrosoft.sql.DatetimeOffsetvalue.voidsetDateTimeOffset(int parameterIndex, DateTimeOffset x, int scale, boolean forceEncrypt)Sets the designated parameter to the givenmicrosoft.sql.DatetimeOffsetvalue.voidsetDouble(int parameterIndex, double x, boolean forceEncrypt)Sets the designated parameter to the given Javadoublevalue.voidsetFloat(int parameterIndex, float x, boolean forceEncrypt)Sets the designated parameter to the given Javafloatvalue.voidsetGeography(int parameterIndex, Geography x)Sets the designated parameter to the givenmicrosoft.sql.GeographyClass object.voidsetGeometry(int parameterIndex, Geometry x)Sets the designated parameter to the givenmicrosoft.sql.GeometryClass object.voidsetInt(int parameterIndex, int value, boolean forceEncrypt)Sets the designated parameter to the given Javaintvalue.voidsetLong(int parameterIndex, long x, boolean forceEncrypt)Sets the designated parameter to the given Javalongvalue.voidsetMoney(int parameterIndex, BigDecimal x)Sets the designated parameter to the givenjava.math.BigDecimalvalue.voidsetMoney(int parameterIndex, BigDecimal x, boolean forceEncrypt)Sets the designated parameter to the givenjava.math.BigDecimalvalue.voidsetNString(int parameterIndex, String value, boolean forceEncrypt)Sets the designated parameter to the givenStringobject.voidsetObject(int parameterIndex, Object x, int targetSqlType, Integer precision, int scale)Sets the value of the designated parameter with the given object.voidsetObject(int parameterIndex, Object x, int targetSqlType, Integer precision, int scale, boolean forceEncrypt)Sets the value of the designated parameter with the given object.voidsetObject(int parameterIndex, Object x, SQLType targetSqlType, Integer precision, Integer scale)Sets the value of the designated parameter with the given object.voidsetObject(int parameterIndex, Object x, SQLType targetSqlType, Integer precision, Integer scale, boolean forceEncrypt)Sets the value of the designated parameter with the given object.voidsetShort(int parameterIndex, short x, boolean forceEncrypt)Sets the designated parameter to the given Javashortvalue.voidsetSmallDateTime(int parameterIndex, Timestamp x)Sets the designated parameter to the givenjava.sql.Timestampvalue.voidsetSmallDateTime(int parameterIndex, Timestamp x, boolean forceEncrypt)Sets the designated parameter to the givenjava.sql.Timestampvalue.voidsetSmallMoney(int parameterIndex, BigDecimal x)Sets the designated parameter to the givenjava.math.BigDecimalvalue.voidsetSmallMoney(int parameterIndex, BigDecimal x, boolean forceEncrypt)Sets the designated parameter to the givenjava.math.BigDecimalvalue.voidsetString(int parameterIndex, String str, boolean forceEncrypt)Sets the designated parameter to the given JavaStringvalue.voidsetStructured(int parameterIndex, String tvpName, ISQLServerDataRecord tvpBulkRecord)Sets the server bulk record to populate a table valued parameter.voidsetStructured(int parameterIndex, String tvpName, SQLServerDataTable tvpDataTable)Sets the data table to populates a table valued parameter.voidsetStructured(int parameterIndex, String tvpName, ResultSet tvpResultSet)Sets the result set to populate a table-valued parameter.voidsetTime(int parameterIndex, Time x, int scale)Sets the designated parameter to the givenjava.sql.Timevalue.voidsetTime(int parameterIndex, Time x, int scale, boolean forceEncrypt)Sets the designated parameter to the givenjava.sql.Timevalue.voidsetTime(int parameterIndex, Time x, Calendar cal, boolean forceEncrypt)Sets the designated parameter to the givenjava.sql.Timevalue.voidsetTimestamp(int parameterIndex, Timestamp x, int scale)Sets the designated parameter to the givenjava.sql.Timestampvalue.voidsetTimestamp(int parameterIndex, Timestamp x, int scale, boolean forceEncrypt)Sets the designated parameter to the givenjava.sql.Timestampvalue.voidsetTimestamp(int parameterIndex, Timestamp x, Calendar cal, boolean forceEncrypt)Sets the designated parameter to the givenjava.sql.Timestampvalue.voidsetUniqueIdentifier(int parameterIndex, String guid)Sets the designated parameter to the given String.voidsetUniqueIdentifier(int parameterIndex, String guid, boolean forceEncrypt)Sets the designated parameter to the given String.voidsetUseFmtOnly(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 Detail
-
setDateTimeOffset
void setDateTimeOffset(int parameterIndex, DateTimeOffset x) throws SQLServerExceptionSets the designated parameter to the givenmicrosoft.sql.DateTimeOffsetvalue.- 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 SQLServerExceptionSets 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 SQLServerExceptionSets 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
int getPreparedStatementHandle() throws SQLServerExceptionThe 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 SQLServerExceptionSets the designated parameter to the givenjava.math.BigDecimalvalue. The driver converts this to an SQLNUMERICvalue 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 SQLServerExceptionSets the designated parameter to the givenjava.math.BigDecimalvalue. The driver converts this to an SQLNUMERICvalue 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
void setMoney(int parameterIndex, BigDecimal x) throws SQLServerExceptionSets the designated parameter to the givenjava.math.BigDecimalvalue. The driver converts this to an SQLNUMERICvalue 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
void setMoney(int parameterIndex, BigDecimal x, boolean forceEncrypt) throws SQLServerExceptionSets the designated parameter to the givenjava.math.BigDecimalvalue. The driver converts this to an SQLNUMERICvalue 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
void setSmallMoney(int parameterIndex, BigDecimal x) throws SQLServerExceptionSets the designated parameter to the givenjava.math.BigDecimalvalue. The driver converts this to an SQLNUMERICvalue 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 SQLServerExceptionSets the designated parameter to the givenjava.math.BigDecimalvalue. The driver converts this to an SQLNUMERICvalue 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
void setBoolean(int parameterIndex, boolean x, boolean forceEncrypt) throws SQLServerExceptionSets the designated parameter to the given Javabooleanvalue. The driver converts this to an SQLBITorBOOLEANvalue 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
void setByte(int parameterIndex, byte x, boolean forceEncrypt) throws SQLServerExceptionSets the designated parameter to the given Javabytevalue. The driver converts this to an SQLTINYINTvalue 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
void setBytes(int parameterIndex, byte[] x, boolean forceEncrypt) throws SQLServerExceptionSets the designated parameter to the given Java array of bytes. The driver converts this to an SQLVARBINARYorLONGVARBINARY(depending on the argument's size relative to the driver's limits onVARBINARYvalues) 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
void setUniqueIdentifier(int parameterIndex, String guid) throws SQLServerExceptionSets 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 SQLServerExceptionSets 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
void setDouble(int parameterIndex, double x, boolean forceEncrypt) throws SQLServerExceptionSets the designated parameter to the given Javadoublevalue. The driver converts this to an SQLDOUBLEvalue 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
void setFloat(int parameterIndex, float x, boolean forceEncrypt) throws SQLServerExceptionSets the designated parameter to the given Javafloatvalue. The driver converts this to an SQLREALvalue 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
void setGeometry(int parameterIndex, Geometry x) throws SQLServerExceptionSets the designated parameter to the givenmicrosoft.sql.GeometryClass object. The driver converts this to an SQLREALvalue 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
void setGeography(int parameterIndex, Geography x) throws SQLServerExceptionSets the designated parameter to the givenmicrosoft.sql.GeographyClass object. The driver converts this to an SQLREALvalue 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
void setInt(int parameterIndex, int value, boolean forceEncrypt) throws SQLServerExceptionSets the designated parameter to the given Javaintvalue. The driver converts this to an SQLINTEGERvalue 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
void setLong(int parameterIndex, long x, boolean forceEncrypt) throws SQLServerExceptionSets the designated parameter to the given Javalongvalue. The driver converts this to an SQLBIGINTvalue 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 SQLServerExceptionSets 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.writeSQLto 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 SQLServerExceptionSets 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.writeSQLto 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
void setShort(int parameterIndex, short x, boolean forceEncrypt) throws SQLServerExceptionSets the designated parameter to the given Javashortvalue. The driver converts this to an SQLSMALLINTvalue 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
void setString(int parameterIndex, String str, boolean forceEncrypt) throws SQLServerExceptionSets the designated parameter to the given JavaStringvalue. The driver converts this to an SQLVARCHARorLONGVARCHARvalue (depending on the argument's size relative to the driver's limits onVARCHARvalues) 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
void setNString(int parameterIndex, String value, boolean forceEncrypt) throws SQLServerExceptionSets the designated parameter to the givenStringobject. The driver converts this to a SQLNCHARorNVARCHARorLONGNVARCHARvalue (depending on the argument's size relative to the driver's limits onNVARCHARvalues) 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
void setTime(int parameterIndex, Time x, int scale) throws SQLServerExceptionSets the designated parameter to the givenjava.sql.Timevalue.- 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
void setTime(int parameterIndex, Time x, int scale, boolean forceEncrypt) throws SQLServerExceptionSets the designated parameter to the givenjava.sql.Timevalue.- 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
void setTimestamp(int parameterIndex, Timestamp x, int scale) throws SQLServerExceptionSets the designated parameter to the givenjava.sql.Timestampvalue.- 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 SQLServerExceptionSets the designated parameter to the givenjava.sql.Timestampvalue.- 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
void setDateTimeOffset(int parameterIndex, DateTimeOffset x, int scale) throws SQLServerExceptionSets the designated parameter to the givenmicrosoft.sql.DatetimeOffsetvalue.- 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 SQLServerExceptionSets the designated parameter to the givenmicrosoft.sql.DatetimeOffsetvalue.- 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
void setDateTime(int parameterIndex, Timestamp x) throws SQLServerExceptionSets the designated parameter to the givenjava.sql.Timestampvalue.- Parameters:
parameterIndex- the first parameter is 1, the second is 2, ...x- the parameter value- Throws:
SQLServerException- when an error occurs
-
setDateTime
void setDateTime(int parameterIndex, Timestamp x, boolean forceEncrypt) throws SQLServerExceptionSets the designated parameter to the givenjava.sql.Timestampvalue.- 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
void setSmallDateTime(int parameterIndex, Timestamp x) throws SQLServerExceptionSets the designated parameter to the givenjava.sql.Timestampvalue.- 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 SQLServerExceptionSets the designated parameter to the givenjava.sql.Timestampvalue.- 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 SQLServerExceptionSets 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 SQLServerExceptionSets 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 SQLServerExceptionSets 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 SQLServerExceptionSets the designated parameter to the givenjava.sql.Datevalue, using the givenCalendarobject. The driver uses theCalendarobject to construct an SQLDATEvalue, which the driver then sends to the database. With aCalendarobject, the driver can calculate the date taking into account a custom timezone. If noCalendarobject 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- theCalendarobject 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 SQLServerExceptionSets the designated parameter to the givenjava.sql.Timevalue. The driver converts this to an SQLTIMEvalue when it sends it to the database.- Parameters:
parameterIndex- the first parameter is 1, the second is 2, ...x- the parameter valuecal- theCalendarobject 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 SQLServerExceptionSets the designated parameter to the givenjava.sql.Timestampvalue. The driver converts this to an SQLTIMESTAMPvalue when it sends it to the database.- Parameters:
parameterIndex- the first parameter is 1, the second is 2, ...x- the parameter valuecal- theCalendarobject 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
ParameterMetaData getParameterMetaData(boolean forceRefresh) throws SQLServerException
Returns parameter metadata for the prepared statement.- Parameters:
forceRefresh- If true the cache will not be used to retrieve the metadata.- Returns:
- Per the description.
- Throws:
SQLServerException- when an error occurs
-
getUseFmtOnly
boolean getUseFmtOnly() throws SQLServerExceptionReturns the current flag value for useFmtOnly.- Returns:
- 'useFmtOnly' property value.
- Throws:
SQLServerException- when the connection is closed.
-
setUseFmtOnly
void setUseFmtOnly(boolean useFmtOnly) throws SQLServerExceptionSpecifies the flag to use FMTONLY for parameter metadata queries.- Parameters:
useFmtOnly- boolean value for 'useFmtOnly'.- Throws:
SQLServerException- when the connection is closed.
-
-