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 voidaddBatch()voidaddBatch(String sql)voidclearBatch()voidclearParameters()booleanexecute()booleanexecute(String sql)int[]executeBatch()Sends a batch of statements to the database.long[]executeLargeBatch()longexecuteLargeUpdate()ResultSetexecuteQuery()ResultSetexecuteQuery(String sql)intexecuteUpdate()intexecuteUpdate(String sql)ResultSetMetaDatagetMetaData()ParameterMetaDatagetParameterMetaData()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.voidsetArray(int i, Array x)voidsetAsciiStream(int parameterIndex, InputStream x)voidsetAsciiStream(int n, InputStream x, int length)voidsetAsciiStream(int parameterIndex, InputStream x, long length)voidsetBigDecimal(int parameterIndex, BigDecimal x)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.voidsetBinaryStream(int parameterIndex, InputStream x)voidsetBinaryStream(int n, InputStream x, int length)voidsetBinaryStream(int parameterIndex, InputStream x, long length)voidsetBlob(int parameterIndex, InputStream inputStream)voidsetBlob(int parameterIndex, InputStream inputStream, long length)voidsetBlob(int i, Blob x)voidsetBoolean(int n, boolean x)voidsetBoolean(int n, boolean x, boolean forceEncrypt)Sets the designated parameter to the given Javabooleanvalue.voidsetByte(int n, byte x)voidsetByte(int n, byte x, boolean forceEncrypt)Sets the designated parameter to the given Javabytevalue.voidsetBytes(int n, byte[] x)voidsetBytes(int n, byte[] x, boolean forceEncrypt)Sets the designated parameter to the given Java array of bytes.voidsetCharacterStream(int parameterIndex, Reader reader)voidsetCharacterStream(int n, Reader reader, int length)voidsetCharacterStream(int parameterIndex, Reader reader, long length)voidsetClob(int parameterIndex, Reader reader)voidsetClob(int parameterIndex, Reader reader, long length)voidsetClob(int parameterIndex, Clob clobValue)voidsetDate(int n, Date x)voidsetDate(int n, Date x, Calendar cal)voidsetDate(int n, Date x, Calendar cal, boolean forceEncrypt)Sets the designated parameter to the givenjava.sql.Datevalue, using the givenCalendarobject.voidsetDateTime(int n, Timestamp x)Sets the designated parameter to the givenjava.sql.Timestampvalue.voidsetDateTime(int n, Timestamp x, boolean forceEncrypt)Sets the designated parameter to the givenjava.sql.Timestampvalue.voidsetDateTimeOffset(int n, DateTimeOffset x)Sets the designated parameter to the givenmicrosoft.sql.DateTimeOffsetvalue.voidsetDateTimeOffset(int n, DateTimeOffset x, int scale)Sets the designated parameter to the givenmicrosoft.sql.DatetimeOffsetvalue.voidsetDateTimeOffset(int n, DateTimeOffset x, int scale, boolean forceEncrypt)Sets the designated parameter to the givenmicrosoft.sql.DatetimeOffsetvalue.voidsetDouble(int n, double x)voidsetDouble(int n, double x, boolean forceEncrypt)Sets the designated parameter to the given Javadoublevalue.voidsetFloat(int n, float x)voidsetFloat(int n, float x, boolean forceEncrypt)Sets the designated parameter to the given Javafloatvalue.voidsetGeography(int n, Geography x)Sets the designated parameter to the givenmicrosoft.sql.GeographyClass object.voidsetGeometry(int n, Geometry x)Sets the designated parameter to the givenmicrosoft.sql.GeometryClass object.voidsetInt(int n, int value)voidsetInt(int n, int value, boolean forceEncrypt)Sets the designated parameter to the given Javaintvalue.voidsetLong(int n, long x)voidsetLong(int n, long x, boolean forceEncrypt)Sets the designated parameter to the given Javalongvalue.voidsetMoney(int n, BigDecimal x)Sets the designated parameter to the givenjava.math.BigDecimalvalue.voidsetMoney(int n, BigDecimal x, boolean forceEncrypt)Sets the designated parameter to the givenjava.math.BigDecimalvalue.voidsetNCharacterStream(int parameterIndex, Reader value)voidsetNCharacterStream(int parameterIndex, Reader value, long length)voidsetNClob(int parameterIndex, Reader reader)voidsetNClob(int parameterIndex, Reader reader, long length)voidsetNClob(int parameterIndex, NClob value)voidsetNString(int parameterIndex, String value)voidsetNString(int parameterIndex, String value, boolean forceEncrypt)Sets the designated parameter to the givenStringobject.voidsetNull(int index, int jdbcType)voidsetNull(int paramIndex, int sqlType, String typeName)voidsetObject(int index, Object obj)voidsetObject(int n, Object obj, int jdbcType)voidsetObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength)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 index, Object obj, SQLType jdbcType)voidsetObject(int parameterIndex, Object x, SQLType targetSqlType, int scaleOrLength)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.voidsetRef(int i, Ref x)voidsetRowId(int parameterIndex, RowId x)voidsetShort(int index, short x)voidsetShort(int index, short x, boolean forceEncrypt)Sets the designated parameter to the given Javashortvalue.voidsetSmallDateTime(int n, Timestamp x)Sets the designated parameter to the givenjava.sql.Timestampvalue.voidsetSmallDateTime(int n, Timestamp x, boolean forceEncrypt)Sets the designated parameter to the givenjava.sql.Timestampvalue.voidsetSmallMoney(int n, BigDecimal x)Sets the designated parameter to the givenjava.math.BigDecimalvalue.voidsetSmallMoney(int n, BigDecimal x, boolean forceEncrypt)Sets the designated parameter to the givenjava.math.BigDecimalvalue.voidsetSQLXML(int parameterIndex, SQLXML xmlObject)voidsetString(int index, String str)voidsetString(int index, String str, boolean forceEncrypt)Sets the designated parameter to the given JavaStringvalue.voidsetStructured(int n, String tvpName, ISQLServerDataRecord tvpBulkRecord)Sets the server bulk record to populate a table valued parameter.voidsetStructured(int n, String tvpName, SQLServerDataTable tvpDataTable)Sets the data table to populates a table valued parameter.voidsetStructured(int n, String tvpName, ResultSet tvpResultSet)Sets the result set to populate a table-valued parameter.voidsetTime(int n, Time x)voidsetTime(int n, Time x, int scale)Sets the designated parameter to the givenjava.sql.Timevalue.voidsetTime(int n, Time x, int scale, boolean forceEncrypt)Sets the designated parameter to the givenjava.sql.Timevalue.voidsetTime(int n, Time x, Calendar cal)voidsetTime(int n, Time x, Calendar cal, boolean forceEncrypt)Sets the designated parameter to the givenjava.sql.Timevalue.voidsetTimestamp(int n, Timestamp x)voidsetTimestamp(int n, Timestamp x, int scale)Sets the designated parameter to the givenjava.sql.Timestampvalue.voidsetTimestamp(int n, Timestamp x, int scale, boolean forceEncrypt)Sets the designated parameter to the givenjava.sql.Timestampvalue.voidsetTimestamp(int n, Timestamp x, Calendar cal)voidsetTimestamp(int n, Timestamp x, Calendar cal, boolean forceEncrypt)Sets the designated parameter to the givenjava.sql.Timestampvalue.voidsetUnicodeStream(int n, InputStream x, int length)Deprecated.voidsetUniqueIdentifier(int index, String guid)Sets the designated parameter to the given String.voidsetUniqueIdentifier(int index, String guid, boolean forceEncrypt)Sets the designated parameter to the given String.voidsetURL(int parameterIndex, URL x)voidsetUseFmtOnly(boolean useFmtOnly)Specifies the flag to use FMTONLY for parameter metadata queries.StringtoString()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:
toStringin classSQLServerStatement
-
getPreparedStatementHandle
public int getPreparedStatementHandle() throws SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementThe server handle for this prepared statement. If a value < 1 is returned no handle has been created.- Specified by:
getPreparedStatementHandlein interfaceISQLServerPreparedStatement- Returns:
- Per the description.
- Throws:
SQLServerException- when an error occurs
-
clearParameters
public final void clearParameters() throws SQLServerException- Specified by:
clearParametersin interfacePreparedStatement- Throws:
SQLServerException
-
executeQuery
public ResultSet executeQuery() throws SQLServerException, SQLTimeoutException
- Specified by:
executeQueryin interfacePreparedStatement- Throws:
SQLServerExceptionSQLTimeoutException
-
executeUpdate
public int executeUpdate() throws SQLServerException, SQLTimeoutException- Specified by:
executeUpdatein interfacePreparedStatement- Throws:
SQLServerExceptionSQLTimeoutException
-
executeLargeUpdate
public long executeLargeUpdate() throws SQLServerException, SQLTimeoutException- Specified by:
executeLargeUpdatein interfacePreparedStatement- Throws:
SQLServerExceptionSQLTimeoutException
-
execute
public boolean execute() throws SQLServerException, SQLTimeoutException- Specified by:
executein interfacePreparedStatement- Throws:
SQLServerExceptionSQLTimeoutException
-
getMetaData
public final ResultSetMetaData getMetaData() throws SQLServerException, SQLTimeoutException
- Specified by:
getMetaDatain interfacePreparedStatement- Throws:
SQLServerExceptionSQLTimeoutException
-
setAsciiStream
public final void setAsciiStream(int parameterIndex, InputStream x) throws SQLException- Specified by:
setAsciiStreamin interfacePreparedStatement- Throws:
SQLException
-
setAsciiStream
public final void setAsciiStream(int n, InputStream x, int length) throws SQLServerException- Specified by:
setAsciiStreamin interfacePreparedStatement- Throws:
SQLServerException
-
setAsciiStream
public final void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException- Specified by:
setAsciiStreamin interfacePreparedStatement- Throws:
SQLException
-
setBigDecimal
public final void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLServerException- Specified by:
setBigDecimalin interfacePreparedStatement- Throws:
SQLServerException
-
setBigDecimal
public final void setBigDecimal(int parameterIndex, BigDecimal x, int precision, int scale) throws SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the givenjava.math.BigDecimalvalue. The driver converts this to an SQLNUMERICvalue when it sends it to the database.- Specified by:
setBigDecimalin 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 SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the givenjava.math.BigDecimalvalue. The driver converts this to an SQLNUMERICvalue when it sends it to the database.- Specified by:
setBigDecimalin 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 SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the givenjava.math.BigDecimalvalue. The driver converts this to an SQLNUMERICvalue when it sends it to the database.- Specified by:
setMoneyin 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 SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the givenjava.math.BigDecimalvalue. The driver converts this to an SQLNUMERICvalue when it sends it to the database.- Specified by:
setMoneyin 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 SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the givenjava.math.BigDecimalvalue. The driver converts this to an SQLNUMERICvalue when it sends it to the database.- Specified by:
setSmallMoneyin 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 SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the givenjava.math.BigDecimalvalue. The driver converts this to an SQLNUMERICvalue when it sends it to the database.- Specified by:
setSmallMoneyin 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:
setBinaryStreamin interfacePreparedStatement- Throws:
SQLException
-
setBinaryStream
public final void setBinaryStream(int n, InputStream x, int length) throws SQLServerException- Specified by:
setBinaryStreamin interfacePreparedStatement- Throws:
SQLServerException
-
setBinaryStream
public final void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException- Specified by:
setBinaryStreamin interfacePreparedStatement- Throws:
SQLException
-
setBoolean
public final void setBoolean(int n, boolean x) throws SQLServerException- Specified by:
setBooleanin interfacePreparedStatement- Throws:
SQLServerException
-
setBoolean
public final void setBoolean(int n, boolean x, boolean forceEncrypt) throws SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the given Javabooleanvalue. The driver converts this to an SQLBITorBOOLEANvalue when it sends it to the database.- Specified by:
setBooleanin 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:
setBytein interfacePreparedStatement- Throws:
SQLServerException
-
setByte
public final void setByte(int n, byte x, boolean forceEncrypt) throws SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the given Javabytevalue. The driver converts this to an SQLTINYINTvalue when it sends it to the database.- Specified by:
setBytein 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:
setBytesin interfacePreparedStatement- Throws:
SQLServerException
-
setBytes
public final void setBytes(int n, byte[] x, boolean forceEncrypt) throws SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets 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.- Specified by:
setBytesin 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 SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the given String. The driver converts this to an SQLGUID- Specified by:
setUniqueIdentifierin 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 SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the given String. The driver converts this to an SQLGUID- Specified by:
setUniqueIdentifierin 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:
setDoublein interfacePreparedStatement- Throws:
SQLServerException
-
setDouble
public final void setDouble(int n, double x, boolean forceEncrypt) throws SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the given Javadoublevalue. The driver converts this to an SQLDOUBLEvalue when it sends it to the database.- Specified by:
setDoublein 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:
setFloatin interfacePreparedStatement- Throws:
SQLServerException
-
setFloat
public final void setFloat(int n, float x, boolean forceEncrypt) throws SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the given Javafloatvalue. The driver converts this to an SQLREALvalue when it sends it to the database.- Specified by:
setFloatin 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 SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the givenmicrosoft.sql.GeometryClass object. The driver converts this to an SQLREALvalue when it sends it to the database.- Specified by:
setGeometryin 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 SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the givenmicrosoft.sql.GeographyClass object. The driver converts this to an SQLREALvalue when it sends it to the database.- Specified by:
setGeographyin 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:
setIntin interfacePreparedStatement- Throws:
SQLServerException
-
setInt
public final void setInt(int n, int value, boolean forceEncrypt) throws SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the given Javaintvalue. The driver converts this to an SQLINTEGERvalue when it sends it to the database.- Specified by:
setIntin 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:
setLongin interfacePreparedStatement- Throws:
SQLServerException
-
setLong
public final void setLong(int n, long x, boolean forceEncrypt) throws SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the given Javalongvalue. The driver converts this to an SQLBIGINTvalue when it sends it to the database.- Specified by:
setLongin 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:
setNullin interfacePreparedStatement- Throws:
SQLServerException
-
setObject
public final void setObject(int index, Object obj) throws SQLServerException- Specified by:
setObjectin interfacePreparedStatement- Throws:
SQLServerException
-
setObject
public final void setObject(int n, Object obj, int jdbcType) throws SQLServerException- Specified by:
setObjectin interfacePreparedStatement- Throws:
SQLServerException
-
setObject
public final void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLServerException- Specified by:
setObjectin interfacePreparedStatement- Throws:
SQLServerException
-
setObject
public final void setObject(int parameterIndex, Object x, int targetSqlType, Integer precision, int scale) throws SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets 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.
- Specified by:
setObjectin 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 SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets 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.
- Specified by:
setObjectin 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:
setObjectin interfacePreparedStatement- Throws:
SQLServerException
-
setObject
public final void setObject(int parameterIndex, Object x, SQLType targetSqlType, int scaleOrLength) throws SQLServerException- Specified by:
setObjectin interfacePreparedStatement- Throws:
SQLServerException
-
setObject
public final void setObject(int parameterIndex, Object x, SQLType targetSqlType, Integer precision, Integer scale) throws SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets 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:
setObjectin 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 SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets 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:
setObjectin 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:
setShortin interfacePreparedStatement- Throws:
SQLServerException
-
setShort
public final void setShort(int index, short x, boolean forceEncrypt) throws SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the given Javashortvalue. The driver converts this to an SQLSMALLINTvalue when it sends it to the database.- Specified by:
setShortin 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:
setStringin interfacePreparedStatement- Throws:
SQLServerException
-
setString
public final void setString(int index, String str, boolean forceEncrypt) throws SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets 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.- Specified by:
setStringin 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:
setNStringin interfacePreparedStatement- Throws:
SQLException
-
setNString
public final void setNString(int parameterIndex, String value, boolean forceEncrypt) throws SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets 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.- Specified by:
setNStringin 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:
setTimein interfacePreparedStatement- Throws:
SQLServerException
-
setTime
public final void setTime(int n, Time x, int scale) throws SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the givenjava.sql.Timevalue.- Specified by:
setTimein 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 SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the givenjava.sql.Timevalue.- Specified by:
setTimein 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:
setTimestampin interfacePreparedStatement- Throws:
SQLServerException
-
setTimestamp
public final void setTimestamp(int n, Timestamp x, int scale) throws SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the givenjava.sql.Timestampvalue.- Specified by:
setTimestampin 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 SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the givenjava.sql.Timestampvalue.- Specified by:
setTimestampin 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 SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the givenmicrosoft.sql.DateTimeOffsetvalue.- Specified by:
setDateTimeOffsetin 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 SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the givenmicrosoft.sql.DatetimeOffsetvalue.- Specified by:
setDateTimeOffsetin 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 SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the givenmicrosoft.sql.DatetimeOffsetvalue.- Specified by:
setDateTimeOffsetin 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:
setDatein interfacePreparedStatement- Throws:
SQLServerException
-
setDateTime
public final void setDateTime(int n, Timestamp x) throws SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the givenjava.sql.Timestampvalue.- Specified by:
setDateTimein 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 SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the givenjava.sql.Timestampvalue.- Specified by:
setDateTimein 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 SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the givenjava.sql.Timestampvalue.- Specified by:
setSmallDateTimein 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 SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the givenjava.sql.Timestampvalue.- Specified by:
setSmallDateTimein 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 SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the data table to populates a table valued parameter.- Specified by:
setStructuredin 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 SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the result set to populate a table-valued parameter.- Specified by:
setStructuredin 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 SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the server bulk record to populate a table valued parameter.- Specified by:
setStructuredin 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:
setUnicodeStreamin interfacePreparedStatement- Throws:
SQLException
-
addBatch
public final void addBatch() throws SQLServerException- Specified by:
addBatchin interfacePreparedStatement- Throws:
SQLServerException
-
clearBatch
public final void clearBatch() throws SQLServerException- Specified by:
clearBatchin interfaceStatement- Overrides:
clearBatchin classSQLServerStatement- Throws:
SQLServerException
-
executeBatch
public int[] executeBatch() throws SQLServerException, BatchUpdateException, SQLTimeoutExceptionDescription copied from class:SQLServerStatementSends a batch of statements to the database.- Specified by:
executeBatchin interfaceStatement- Overrides:
executeBatchin classSQLServerStatement- Throws:
SQLServerExceptionBatchUpdateExceptionSQLTimeoutException
-
executeLargeBatch
public long[] executeLargeBatch() throws SQLServerException, BatchUpdateException, SQLTimeoutException- Specified by:
executeLargeBatchin interfaceStatement- Overrides:
executeLargeBatchin classSQLServerStatement- Throws:
SQLServerExceptionBatchUpdateExceptionSQLTimeoutException
-
setUseFmtOnly
public final void setUseFmtOnly(boolean useFmtOnly) throws SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSpecifies the flag to use FMTONLY for parameter metadata queries.- Specified by:
setUseFmtOnlyin interfaceISQLServerPreparedStatement- Parameters:
useFmtOnly- boolean value for 'useFmtOnly'.- Throws:
SQLServerException- when the connection is closed.
-
getUseFmtOnly
public final boolean getUseFmtOnly() throws SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementReturns the current flag value for useFmtOnly.- Specified by:
getUseFmtOnlyin 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:
setCharacterStreamin interfacePreparedStatement- Throws:
SQLException
-
setCharacterStream
public final void setCharacterStream(int n, Reader reader, int length) throws SQLServerException- Specified by:
setCharacterStreamin interfacePreparedStatement- Throws:
SQLServerException
-
setCharacterStream
public final void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException- Specified by:
setCharacterStreamin interfacePreparedStatement- Throws:
SQLException
-
setNCharacterStream
public final void setNCharacterStream(int parameterIndex, Reader value) throws SQLException- Specified by:
setNCharacterStreamin interfacePreparedStatement- Throws:
SQLException
-
setNCharacterStream
public final void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException- Specified by:
setNCharacterStreamin interfacePreparedStatement- Throws:
SQLException
-
setRef
public final void setRef(int i, Ref x) throws SQLException- Specified by:
setRefin interfacePreparedStatement- Throws:
SQLException
-
setBlob
public final void setBlob(int i, Blob x) throws SQLException- Specified by:
setBlobin interfacePreparedStatement- Throws:
SQLException
-
setBlob
public final void setBlob(int parameterIndex, InputStream inputStream) throws SQLException- Specified by:
setBlobin interfacePreparedStatement- Throws:
SQLException
-
setBlob
public final void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException- Specified by:
setBlobin interfacePreparedStatement- Throws:
SQLException
-
setClob
public final void setClob(int parameterIndex, Clob clobValue) throws SQLException- Specified by:
setClobin interfacePreparedStatement- Throws:
SQLException
-
setClob
public final void setClob(int parameterIndex, Reader reader) throws SQLException- Specified by:
setClobin interfacePreparedStatement- Throws:
SQLException
-
setClob
public final void setClob(int parameterIndex, Reader reader, long length) throws SQLException- Specified by:
setClobin interfacePreparedStatement- Throws:
SQLException
-
setNClob
public final void setNClob(int parameterIndex, NClob value) throws SQLException- Specified by:
setNClobin interfacePreparedStatement- Throws:
SQLException
-
setNClob
public final void setNClob(int parameterIndex, Reader reader) throws SQLException- Specified by:
setNClobin interfacePreparedStatement- Throws:
SQLException
-
setNClob
public final void setNClob(int parameterIndex, Reader reader, long length) throws SQLException- Specified by:
setNClobin interfacePreparedStatement- Throws:
SQLException
-
setArray
public final void setArray(int i, Array x) throws SQLException- Specified by:
setArrayin interfacePreparedStatement- Throws:
SQLException
-
setDate
public final void setDate(int n, Date x, Calendar cal) throws SQLServerException- Specified by:
setDatein interfacePreparedStatement- Throws:
SQLServerException
-
setDate
public final void setDate(int n, Date x, Calendar cal, boolean forceEncrypt) throws SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets 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.- Specified by:
setDatein interfaceISQLServerPreparedStatement- Parameters:
n- 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
public final void setTime(int n, Time x, Calendar cal) throws SQLServerException- Specified by:
setTimein interfacePreparedStatement- Throws:
SQLServerException
-
setTime
public final void setTime(int n, Time x, Calendar cal, boolean forceEncrypt) throws SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the givenjava.sql.Timevalue. The driver converts this to an SQLTIMEvalue when it sends it to the database.- Specified by:
setTimein interfaceISQLServerPreparedStatement- Parameters:
n- 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
public final void setTimestamp(int n, Timestamp x, Calendar cal) throws SQLServerException- Specified by:
setTimestampin interfacePreparedStatement- Throws:
SQLServerException
-
setTimestamp
public final void setTimestamp(int n, Timestamp x, Calendar cal, boolean forceEncrypt) throws SQLServerExceptionDescription copied from interface:ISQLServerPreparedStatementSets the designated parameter to the givenjava.sql.Timestampvalue. The driver converts this to an SQLTIMESTAMPvalue when it sends it to the database.- Specified by:
setTimestampin interfaceISQLServerPreparedStatement- Parameters:
n- 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
-
setNull
public final void setNull(int paramIndex, int sqlType, String typeName) throws SQLServerException- Specified by:
setNullin interfacePreparedStatement- Throws:
SQLServerException
-
getParameterMetaData
public final ParameterMetaData getParameterMetaData(boolean forceRefresh) throws SQLServerException
Description copied from interface:ISQLServerPreparedStatementReturns parameter metadata for the prepared statement.- Specified by:
getParameterMetaDatain 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:
getParameterMetaDatain interfacePreparedStatement- Throws:
SQLServerException
-
setURL
public final void setURL(int parameterIndex, URL x) throws SQLException- Specified by:
setURLin interfacePreparedStatement- Throws:
SQLException
-
setRowId
public final void setRowId(int parameterIndex, RowId x) throws SQLException- Specified by:
setRowIdin interfacePreparedStatement- Throws:
SQLException
-
setSQLXML
public final void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException- Specified by:
setSQLXMLin interfacePreparedStatement- Throws:
SQLException
-
executeUpdate
public final int executeUpdate(String sql) throws SQLServerException
- Specified by:
executeUpdatein interfaceStatement- Overrides:
executeUpdatein classSQLServerStatement- Throws:
SQLServerException
-
execute
public final boolean execute(String sql) throws SQLServerException
- Specified by:
executein interfaceStatement- Overrides:
executein classSQLServerStatement- Throws:
SQLServerException
-
executeQuery
public final ResultSet executeQuery(String sql) throws SQLServerException
- Specified by:
executeQueryin interfaceStatement- Overrides:
executeQueryin classSQLServerStatement- Throws:
SQLServerException
-
addBatch
public void addBatch(String sql) throws SQLServerException
- Specified by:
addBatchin interfaceStatement- Overrides:
addBatchin classSQLServerStatement- Throws:
SQLServerException
-
-