dateTimeFormatter for the given column
+ *
+ * @param column
+ * Column ordinal
+ * @return dateTimeFormatter
+ */
+ public DateTimeFormatter getColumnDateTimeFormatter(int column);
+}
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerCallableStatement.java b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerCallableStatement.java
index 280f66f1a..7be9957b3 100644
--- a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerCallableStatement.java
+++ b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerCallableStatement.java
@@ -8,49 +8,1159 @@
package com.microsoft.sqlserver.jdbc;
-import java.sql.SQLException;
+import java.math.BigDecimal;
+import java.sql.SQLType;
+import java.sql.Timestamp;
+import java.util.Calendar;
/**
- *
- * This interface is implemented by SQLServerCallableStatement Class.
- *
+ * This interface is implemented by {@link SQLServerCallableStatement} Class.
*/
public interface ISQLServerCallableStatement extends java.sql.CallableStatement, ISQLServerPreparedStatement {
+
+ @Deprecated
+ public BigDecimal getBigDecimal(String parameterName,
+ int scale) throws SQLServerException;
+
/**
- * Sets parameter parameterName to DateTimeOffset x
+ * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming
+ * language.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @return the column value; if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public Timestamp getDateTime(int index) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming
+ * language.
*
* @param parameterName
- * the name of the parameter
- * @param x
- * DateTimeOffset value
- * @throws SQLException
- * if parameterName does not correspond to a named parameter; if the driver can detect that a data conversion error could occur; if a
- * database access error occurs or this method is called on a closed CallableStatement
+ * the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the
+ * column
+ * @return the column value; if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
+ * when an error occurs
*/
- public void setDateTimeOffset(String parameterName,
- microsoft.sql.DateTimeOffset x) throws SQLException;
+ public Timestamp getDateTime(String parameterName) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming
+ * language. This method uses the given calendar to construct an appropriate millisecond value for the timestamp if the underlying database does
+ * not store timezone information.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param cal
+ * the java.util.Calendar object to use in constructing the dateTime
+ * @return the column value; if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public Timestamp getDateTime(int index,
+ Calendar cal) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming
+ * language. This method uses the given calendar to construct an appropriate millisecond value for the timestamp if the underlying database does
+ * not store timezone information.
+ *
+ * @param name
+ * the name of the column
+ * @param cal
+ * the java.util.Calendar object to use in constructing the dateTime
+ * @return the column value; if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public Timestamp getDateTime(String name,
+ Calendar cal) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming
+ * language.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @return the column value; if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public Timestamp getSmallDateTime(int index) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming
+ * language.
+ *
+ * @param parameterName
+ * The name of a column.
+ * @return the column value; if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public Timestamp getSmallDateTime(String parameterName) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming
+ * language.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param cal
+ * the java.util.Calendar object to use in constructing the smalldateTime
+ * @return the column value; if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public Timestamp getSmallDateTime(int index,
+ Calendar cal) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming
+ * language.
+ *
+ * @param name
+ * The name of a column
+ * @param cal
+ * the java.util.Calendar object to use in constructing the smalldateTime
+ * @return the column value; if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public Timestamp getSmallDateTime(String name,
+ Calendar cal) throws SQLServerException;
/**
* Gets the DateTimeOffset value of parameter with index parameterIndex
*
* @param parameterIndex
* the first parameter is 1, the second is 2, and so on
- * @return DateTimeOffset value
- * @throws SQLException
+ * @return DateTimeOffset value if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
* if parameterIndex is out of range; if a database access error occurs or this method is called on a closed
* CallableStatement
*/
- public microsoft.sql.DateTimeOffset getDateTimeOffset(int parameterIndex) throws SQLException;
+ public microsoft.sql.DateTimeOffset getDateTimeOffset(int parameterIndex) throws SQLServerException;
/**
* Gets the DateTimeOffset value of parameter with name parameterName
*
* @param parameterName
* the name of the parameter
- * @return DateTimeOffset value
- * @throws SQLException
+ * @return DateTimeOffset value if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ */
+ public microsoft.sql.DateTimeOffset getDateTimeOffset(String parameterName) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the designated column in the current row of this ResultSet object as a stream of ASCII characters. The
+ * value can then be read in chunks from the stream. This method is particularly suitable for retrieving large LONGVARCHAR values.
+ * The JDBC driver will do any necessary conversion from the database format into ASCII.
+ *
+ *
+ * Note: All the data in the returned stream must be read prior to getting the value of any other column. The next call to a getter method
+ * implicitly closes the stream. Also, a stream may return 0 when the method InputStream.available is called whether
+ * there is data available or not.
+ *
+ * @param parameterIndex
+ * the first column is 1, the second is 2, ...
+ * @return a Java input stream that delivers the database column value as a stream of one-byte ASCII characters; if the value is SQL
+ * NULL, the value returned is null
+ * @throws SQLServerException
+ * if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set
+ */
+ public java.io.InputStream getAsciiStream(int parameterIndex) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the designated column in the current row of this ResultSet object as a stream of ASCII characters. The
+ * value can then be read in chunks from the stream. This method is particularly suitable for retrieving large LONGVARCHAR values.
+ * The JDBC driver will do any necessary conversion from the database format into ASCII.
+ *
+ *
+ * Note: All the data in the returned stream must be read prior to getting the value of any other column. The next call to a getter method
+ * implicitly closes the stream. Also, a stream may return 0 when the method available is called whether there is data
+ * available or not.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @return a Java input stream that delivers the database column value as a stream of one-byte ASCII characters. If the value is SQL
+ * NULL, the value returned is null.
+ * @throws SQLServerException
+ * if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set
+ */
+ public java.io.InputStream getAsciiStream(String parameterName) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the column specified as a java.math.BigDecimal object.
+ *
+ * @param parameterIndex
+ * The zero-based ordinal of a column.
+ * @return the column value; if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public BigDecimal getMoney(int parameterIndex) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the column specified as a java.math.BigDecimal object.
+ *
+ * @param parameterName
+ * The name of a column.
+ * @return the column value; if the value is SQL NULL, the value returned is null.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public BigDecimal getMoney(String parameterName) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the column specified as a java.math.BigDecimal object.
+ *
+ * @param parameterIndex
+ * The zero-based ordinal of a column.
+ * @return the column value; if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public BigDecimal getSmallMoney(int parameterIndex) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the column specified as a java.math.BigDecimal object.
+ *
+ * @param parameterName
+ * The name of a column.
+ * @return the column value; if the value is SQL NULL, the value returned is null.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public BigDecimal getSmallMoney(String parameterName) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the designated column in the current row of this ResultSet object as a stream of uninterpreted bytes. The
+ * value can then be read in chunks from the stream. This method is particularly suitable for retrieving large LONGVARBINARY values.
+ *
+ *
+ * Note: All the data in the returned stream must be read prior to getting the value of any other column. The next call to a getter method
+ * implicitly closes the stream. Also, a stream may return 0 when the method InputStream.available is called whether
+ * there is data available or not.
+ *
+ * @param parameterIndex
+ * the first column is 1, the second is 2, ...
+ * @return a Java input stream that delivers the database column value as a stream of uninterpreted bytes; if the value is SQL NULL,
+ * the value returned is null
+ * @throws SQLServerException
+ * if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set
+ */
+ public java.io.InputStream getBinaryStream(int parameterIndex) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the designated column in the current row of this ResultSet object as a stream of uninterpreted
+ * bytes. The value can then be read in chunks from the stream. This method is particularly suitable for retrieving large
+ * LONGVARBINARY values.
+ *
+ *
+ * Note: All the data in the returned stream must be read prior to getting the value of any other column. The next call to a getter method
+ * implicitly closes the stream. Also, a stream may return 0 when the method available is called whether there is data
+ * available or not.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @return a Java input stream that delivers the database column value as a stream of uninterpreted bytes; if the value is SQL NULL,
+ * the result is null
+ * @throws SQLServerException
+ * if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set
+ */
+ public java.io.InputStream getBinaryStream(String parameterName) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.sql.Timestamp value. The driver converts this to an SQL TIMESTAMP
+ * value when it sends it to the database.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the parameter value
+ * @param calendar
+ * a java.util.Calendar
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ * @see #getTimestamp
+ */
+ public void setTimestamp(String parameterName,
+ java.sql.Timestamp value,
+ Calendar calendar,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.sql.Time value, using the given Calendar object. The driver uses the
+ * Calendar object to construct an SQL TIME value, which the driver then sends to the database. With a a
+ * Calendar object, the driver can calculate the time taking into account a custom timezone. If no Calendar object is
+ * specified, the driver uses the default timezone, which is that of the virtual machine running the application.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the parameter value
+ * @param calendar
+ * the Calendar object the driver will use to construct the time
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ * @see #getTime
+ */
+ public void setTime(String parameterName,
+ java.sql.Time value,
+ Calendar calendar,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.sql.Date value, using the given Calendar object. The driver uses the
+ * Calendar object to construct an SQL DATE value, which the driver then sends to the database. With a a
+ * Calendar object, the driver can calculate the date taking into account a custom timezone. If no Calendar object is
+ * specified, the driver uses the default timezone, which is that of the virtual machine running the application.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the parameter value
+ * @param calendar
+ * the Calendar object the driver will use to construct the date
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ * @see #getDate
+ */
+ public void setDate(String parameterName,
+ java.sql.Date value,
+ Calendar calendar,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given String object. The driver converts this to a SQL NCHAR or
+ * NVARCHAR or LONGNVARCHAR
+ *
+ * @param parameterName
+ * the name of the parameter to be set
+ * @param value
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if the driver does not support national character sets; if the driver
+ * can detect that a data conversion error could occur; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ */
+ public void setNString(String parameterName,
+ String value,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the value of the designated parameter with the given object.
+ *
+ *
+ * The given Java object will be converted to the given targetSqlType before being sent to the database.
+ *
+ * If the object has a custom mapping (is of a class implementing the interface SQLData), the JDBC driver should call the method
+ * SQLData.writeSQL to write it to the SQL data stream. If, on the other hand, the object is of a class implementing
+ * Ref, Blob, Clob, NClob, Struct, java.net.URL, or
+ * Array, 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.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the object containing the input parameter value
+ * @param sqlType
+ * the SQL type (as defined in java.sql.Types) to be sent to the database. The scale argument may further qualify this type.
+ * @param decimals
+ * for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types, this is the number of digits after the decimal point. For all other
+ * types, this value will be ignored.
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ * @see java.sql.Types
+ * @see #getObject
+ */
+ public void setObject(String parameterName,
+ Object value,
+ int sqlType,
+ int decimals,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the value of the designated parameter with the given object.
+ *
+ *
+ * The given Java object will be converted to the given targetSqlType before being sent to the database.
+ *
+ * If the object has a custom mapping (is of a class implementing the interface SQLData), the JDBC driver should call the method
+ * SQLData.writeSQL to write it to the SQL data stream. If, on the other hand, the object is of a class implementing
+ * Ref, Blob, Clob, NClob, Struct, java.net.URL, or
+ * Array, 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 datatabase- specific abstract data types.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the object containing the input parameter value
+ * @param targetSqlType
+ * the SQL type (as defined in java.sql.Types) to be sent to the database. The scale argument may further qualify this type.
+ * @param precision
+ * the precision of the column.
+ * @param scale
+ * the scale of the column.
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ * @see java.sql.Types
+ * @see #getObject
+ */
+ public void setObject(String parameterName,
+ Object value,
+ int targetSqlType,
+ Integer precision,
+ int scale) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.sql.Timestamp value. The driver converts this to an SQL TIMESTAMP
+ * value when it sends it to the database.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the parameter value
+ * @param scale
+ * the scale of the parameter
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ * @see #getTimestamp
+ */
+ public void setTimestamp(String parameterName,
+ java.sql.Timestamp value,
+ int scale) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.sql.Timestamp value. The driver converts this to an SQL TIMESTAMP
+ * value when it sends it to the database.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the parameter value
+ * @param scale
+ * the scale of the parameter
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ * @see #getTimestamp
+ */
+ public void setTimestamp(String parameterName,
+ java.sql.Timestamp value,
+ int scale,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets parameter parameterName to DateTimeOffset x
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * DateTimeOffset value
+ * @throws SQLServerException
+ * if an error occurs
+ */
+ public void setDateTimeOffset(String parameterName,
+ microsoft.sql.DateTimeOffset value) throws SQLServerException;
+
+ /**
+ * Sets parameter parameterName to DateTimeOffset x
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * DateTimeOffset value
+ * @param scale
+ * the scale of the parameter
+ * @throws SQLServerException
+ * if an error occurs
+ */
+ public void setDateTimeOffset(String parameterName,
+ microsoft.sql.DateTimeOffset value,
+ int scale) throws SQLServerException;
+
+ /**
+ * Sets parameter parameterName to DateTimeOffset x
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * DateTimeOffset value
+ * @param scale
+ * the scale of the parameter
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * if an error occurs
+ */
+ public void setDateTimeOffset(String parameterName,
+ microsoft.sql.DateTimeOffset value,
+ int scale,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.sql.Time value. The driver converts this to an SQL TIME value when it
+ * sends it to the database.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the parameter value
+ * @param scale
+ * the scale of the column
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ * @see #getTime
+ */
+ public void setTime(String parameterName,
+ java.sql.Time value,
+ int scale) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.sql.Time value. The driver converts this to an SQL TIME value when it
+ * sends it to the database.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the parameter value
+ * @param scale
+ * the scale of the column
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ * @see #getTime
+ */
+ public void setTime(String parameterName,
+ java.sql.Time value,
+ int scale,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.sql.Timestamp value. The driver converts this to an SQL DATETIME
+ * value when it sends it to the database.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the parameter value
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ */
+ public void setDateTime(String parameterName,
+ java.sql.Timestamp value) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.sql.Timestamp value. The driver converts this to an SQL DATETIME
+ * value when it sends it to the database.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ */
+ public void setDateTime(String parameterName,
+ java.sql.Timestamp value,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.sql.Timestamp value. The driver converts this to an SQL SMALLDATETIME
+ * value when it sends it to the database.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the parameter value
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ */
+ public void setSmallDateTime(String parameterName,
+ java.sql.Timestamp value) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.sql.Timestamp value. The driver converts this to an SQL SMALLDATETIME
+ * value when it sends it to the database.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ */
+ public void setSmallDateTime(String parameterName,
+ java.sql.Timestamp value,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given String value. The driver converts this to an SQL uniqueIdentifier value
+ * when it sends it to the database.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param guid
+ * the parameter value
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ */
+ public void setUniqueIdentifier(String parameterName,
+ String guid) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given String value. The driver converts this to an SQL uniqueIdentifier value
+ * when it sends it to the database.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param guid
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ */
+ public void setUniqueIdentifier(String parameterName,
+ String guid,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given Java array of bytes. The driver converts this to an SQL VARBINARY or
+ * LONGVARBINARY (depending on the argument's size relative to the driver's limits on VARBINARY values) when it sends it
+ * to the database.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ */
+ public void setBytes(String parameterName,
+ byte[] value,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given Java byte value. The driver converts this to an SQL TINYINT value when it
+ * sends it to the database.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ */
+ public void setByte(String parameterName,
+ byte value,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given Java String value. The driver converts this to an SQL VARCHAR or
+ * LONGVARCHAR value (depending on the argument's size relative to the driver's limits on VARCHAR values) when it sends
+ * it to the database.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ */
+ public void setString(String parameterName,
+ String value,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given Java java.math.BigDecimal value. The driver converts this to an SQL Money
+ * value.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the parameter value
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ */
+ public void setMoney(String parameterName,
+ BigDecimal value) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given Java java.math.BigDecimal value. The driver converts this to an SQL Money
+ * value.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ */
+ public void setMoney(String parameterName,
+ BigDecimal value,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given Java java.math.BigDecimal value. The driver converts this to an SQL
+ * smallMoney value.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the parameter value
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ */
+ public void setSmallMoney(String parameterName,
+ BigDecimal value) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given Java java.math.BigDecimal value. The driver converts this to an SQL
+ * smallMoney value.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ */
+ public void setSmallMoney(String parameterName,
+ BigDecimal value,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.math.BigDecimal value. The driver converts this to an SQL NUMERIC
+ * value when it sends it to the database.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the parameter value
+ * @param precision
+ * the precision of the column
+ * @param scale
+ * the scale of the column
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ */
+ public void setBigDecimal(String parameterName,
+ BigDecimal value,
+ int precision,
+ int scale) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.math.BigDecimal value. The driver converts this to an SQL NUMERIC
+ * value when it sends it to the database.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the parameter value
+ * @param precision
+ * the precision of the column
+ * @param scale
+ * the scale of the column
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ */
+ public void setBigDecimal(String parameterName,
+ BigDecimal value,
+ int precision,
+ int scale,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given Java double value. The driver converts this to an SQL DOUBLE value when it
+ * sends it to the database.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ */
+ public void setDouble(String parameterName,
+ double value,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given Java float value. The driver converts this to an SQL FLOAT value when it
+ * sends it to the database.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ */
+ public void setFloat(String parameterName,
+ float value,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given Java int value. The driver converts this to an SQL INTEGER value when it
+ * sends it to the database.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ */
+ public void setInt(String parameterName,
+ int value,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given Java long value. The driver converts this to an SQL BIGINT value when it
+ * sends it to the database.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ */
+ public void setLong(String parameterName,
+ long value,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given Java short value. The driver converts this to an SQL SMALLINT value when
+ * it sends it to the database.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ */
+ public void setShort(String parameterName,
+ short value,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given Java boolean value. The driver converts this to an SQL BIT or
+ * BOOLEAN value when it sends it to the database.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
+ * CallableStatement
+ */
+ public void setBoolean(String parameterName,
+ boolean value,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Populates a table valued parameter passed to a stored procedure with a data table.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param tvpName
+ * the name of the type TVP
+ * @param tvpDataTable
+ * the data table object
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setStructured(String parameterName,
+ String tvpName,
+ SQLServerDataTable tvpDataTable) throws SQLServerException;
+
+ /**
+ * Populates a table valued parameter passed to a stored procedure with a ResultSet retrieved from another table
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param tvpName
+ * the name of the type TVP
+ * @param tvpResultSet
+ * the source result set object
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setStructured(String parameterName,
+ String tvpName,
+ java.sql.ResultSet tvpResultSet) throws SQLServerException;
+
+ /**
+ * Populates a table valued parameter passed to a stored procedure with an ISQLServerDataRecord object.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param tvpName
+ * the name of the type TVP
+ * @param tvpDataRecord
+ * ISQLServerDataRecord is used for streaming data and the user decides how to use it. tvpDataRecord is an ISQLServerDataRecord
+ * object.the source result set object
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setStructured(String parameterName,
+ String tvpName,
+ ISQLServerDataRecord tvpDataRecord) throws SQLServerException;
+
+ /**
+ * Registers the parameter in ordinal position index to be of JDBC type sqlType. All OUT parameters must be registered before a stored procedure
+ * is executed.
+ *
+ * The JDBC type specified by sqlType for an OUT parameter determines the Java type that must be used in the get method to read the value of that + * parameter. + * + * @param parameterName + * the name of the parameter + * @param sqlType + * the JDBC type code defined by SQLType to use to register the OUT Parameter. + * @param precision + * the sum of the desired number of digits to the left and right of the decimal point. It must be greater than or equal to zero. + * @param scale + * the desired number of digits to the right of the decimal point. It must be greater than or equal to zero. + * @throws SQLServerException + * If any errors occur. + */ + public void registerOutParameter(String parameterName, + SQLType sqlType, + int precision, + int scale) throws SQLServerException; + + /** + * Registers the parameter in ordinal position index to be of JDBC type sqlType. All OUT parameters must be registered before a stored procedure + * is executed. + *
+ * The JDBC type specified by sqlType for an OUT parameter determines the Java type that must be used in the get method to read the value of that + * parameter. + * + * @param parameterIndex + * the first column is 1, the second is 2, ... + * @param sqlType + * the JDBC type code defined by SQLType to use to register the OUT Parameter. + * @param precision + * the sum of the desired number of digits to the left and right of the decimal point. It must be greater than or equal to zero. + * @param scale + * the desired number of digits to the right of the decimal point. It must be greater than or equal to zero. + * @throws SQLServerException + * If any errors occur. + */ + public void registerOutParameter(int parameterIndex, + SQLType sqlType, + int precision, + int scale) throws SQLServerException; + + /** + * Registers the parameter in ordinal position index to be of JDBC type sqlType. All OUT parameters must be registered before a stored procedure + * is executed. + *
+ * The JDBC type specified by sqlType for an OUT parameter determines the Java type that must be used in the get method to read the value of that + * parameter. + * + * @param parameterIndex + * the first column is 1, the second is 2, ... + * @param sqlType + * the JDBC type code defined by SQLType to use to register the OUT Parameter. + * @param precision + * the sum of the desired number of digits to the left and right of the decimal point. It must be greater than or equal to zero. + * @param scale + * the desired number of digits to the right of the decimal point. It must be greater than or equal to zero. + * @throws SQLServerException + * If any errors occur. + */ + public void registerOutParameter(int parameterIndex, + int sqlType, + int precision, + int scale) throws SQLServerException; + + /** + * Registers the parameter in ordinal position index to be of JDBC type sqlType. All OUT parameters must be registered before a stored procedure + * is executed. + *
+ * The JDBC type specified by sqlType for an OUT parameter determines the Java type that must be used in the get method to read the value of that + * parameter. + * + * @param parameterName + * the name of the parameter + * @param sqlType + * the JDBC type code defined by SQLType to use to register the OUT Parameter. + * @param precision + * the sum of the desired number of digits to the left and right of the decimal point. It must be greater than or equal to zero. + * @param scale + * the desired number of digits to the right of the decimal point. It must be greater than or equal to zero. + * @throws SQLServerException + * If any errors occur. + */ + public void registerOutParameter(String parameterName, + int sqlType, + int precision, + int scale) throws SQLServerException; + + /** + * Sets the value of the designated parameter with the given object. + * + *
+ * The given Java object will be converted to the given targetSqlType before being sent to the database.
+ *
+ * If the object has a custom mapping (is of a class implementing the interface SQLData), the JDBC driver should call the method
+ * SQLData.writeSQL to write it to the SQL data stream. If, on the other hand, the object is of a class implementing
+ * Ref, Blob, Clob, NClob, Struct, java.net.URL, or
+ * Array, 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 datatabase- specific abstract data types.
+ *
+ * @param parameterName
+ * the name of the parameter
+ * @param value
+ * the object containing the input parameter value
+ * @param jdbcType
+ * the SQL type (as defined in java.sql.Types) to be sent to the database. The scale argument may further qualify this type.
+ * @param scale
+ * the scale of the column.
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
* if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
* CallableStatement
+ * @see java.sql.Types
+ * @see #getObject
*/
- public microsoft.sql.DateTimeOffset getDateTimeOffset(String parameterName) throws SQLException;
+ public void setObject(String parameterName,
+ Object value,
+ SQLType jdbcType,
+ int scale,
+ boolean forceEncrypt) throws SQLServerException;
}
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerCallableStatement42.java b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerCallableStatement42.java
deleted file mode 100644
index 4684ec4ac..000000000
--- a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerCallableStatement42.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Microsoft JDBC Driver for SQL Server
- *
- * Copyright(c) Microsoft Corporation All rights reserved.
- *
- * This program is made available under the terms of the MIT License. See the LICENSE file in the project root for more information.
- */
-
-package com.microsoft.sqlserver.jdbc;
-
-import java.sql.SQLType;
-
-/**
- * This interface requires all the CallableStatement methods including those are specific to JDBC 4.2
- *
- */
-public interface ISQLServerCallableStatement42 extends ISQLServerCallableStatement, ISQLServerPreparedStatement42 {
-
- public void registerOutParameter(int index,
- SQLType sqlType) throws SQLServerException;
-
- public void registerOutParameter(int index,
- SQLType sqlType,
- String typeName) throws SQLServerException;
-
- public void registerOutParameter(int index,
- SQLType sqlType,
- int scale) throws SQLServerException;
-
- /**
- * Registers the parameter in ordinal position index to be of JDBC type sqlType. All OUT parameters must be registered before a stored procedure
- * is executed.
- *
- * The JDBC type specified by sqlType for an OUT parameter determines the Java type that must be used in the get method to read the value of that - * parameter. - * - * @param index - * the first parameter is 1, the second is 2,... - * @param sqlType - * the JDBC type code defined by SQLType to use to register the OUT Parameter. - * @param precision - * the sum of the desired number of digits to the left and right of the decimal point. It must be greater than or equal to zero. - * @param scale - * the desired number of digits to the right of the decimal point. It must be greater than or equal to zero. - * @throws SQLServerException - * If any errors occur. - */ - public void registerOutParameter(int index, - SQLType sqlType, - int precision, - int scale) throws SQLServerException; - - public void setObject(String sCol, - Object obj, - SQLType jdbcType) throws SQLServerException; - - public void setObject(String sCol, - Object obj, - SQLType jdbcType, - int scale) throws SQLServerException; - - /** - * Sets the value of the designated parameter with the given object. - * - * @param sCol - * the name of the parameter - * @param obj - * the object containing the input parameter value - * @param jdbcType - * the SQL type to be sent to the database - * @param scale - * scale the desired number of digits to the right of the decimal point. It must be greater than or equal to zero. - * @param forceEncrypt - * true if force encryption is on, false if force encryption is off - * @throws SQLServerException - * If any errors occur. - */ - public void setObject(String sCol, - Object obj, - SQLType jdbcType, - int scale, - boolean forceEncrypt) throws SQLServerException; - - public void registerOutParameter(String parameterName, - SQLType sqlType, - String typeName) throws SQLServerException; - - public void registerOutParameter(String parameterName, - SQLType sqlType, - int scale) throws SQLServerException; - - /** - * Registers the parameter in ordinal position index to be of JDBC type sqlType. All OUT parameters must be registered before a stored procedure - * is executed. - *
- * The JDBC type specified by sqlType for an OUT parameter determines the Java type that must be used in the get method to read the value of that
- * parameter.
- *
- * @param parameterName
- * the name of the parameter
- * @param sqlType
- * the JDBC type code defined by SQLType to use to register the OUT Parameter.
- * @param precision
- * the sum of the desired number of digits to the left and right of the decimal point. It must be greater than or equal to zero.
- * @param scale
- * the desired number of digits to the right of the decimal point. It must be greater than or equal to zero.
- * @throws SQLServerException
- * If any errors occur.
- */
- public void registerOutParameter(String parameterName,
- SQLType sqlType,
- int precision,
- int scale) throws SQLServerException;
-
- public void registerOutParameter(String parameterName,
- SQLType sqlType) throws SQLServerException;
-}
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerConnection.java b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerConnection.java
index 57ea5e94a..7ebf9dcfc 100644
--- a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerConnection.java
+++ b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerConnection.java
@@ -1,32 +1,344 @@
-/*
- * Microsoft JDBC Driver for SQL Server
- *
- * Copyright(c) Microsoft Corporation All rights reserved.
- *
- * This program is made available under the terms of the MIT License. See the LICENSE file in the project root for more information.
- */
-
-package com.microsoft.sqlserver.jdbc;
-
-import java.sql.SQLException;
-import java.util.UUID;
-
-/**
- *
- * This interface is implemented by SQLServerConnection Class.
- */
-public interface ISQLServerConnection extends java.sql.Connection {
- // Transaction types.
- // TRANSACTION_SNAPSHOT corresponds to -> SET TRANSACTION ISOLATION LEVEL SNAPSHOT
- public final static int TRANSACTION_SNAPSHOT = 0x1000;
-
- /**
- * Gets the connection ID of the most recent connection attempt, regardless of whether the attempt succeeded or failed.
- *
- * @return 16-byte GUID representing the connection ID of the most recent connection attempt. Or, NULL if there is a failure after the connection
- * request is initiated and the pre-login handshake.
- * @throws SQLException
- * If any errors occur.
- */
- public UUID getClientConnectionId() throws SQLException;
-}
+/*
+ * Microsoft JDBC Driver for SQL Server
+ *
+ * Copyright(c) Microsoft Corporation All rights reserved.
+ *
+ * This program is made available under the terms of the MIT License. See the LICENSE file in the project root for more information.
+ */
+
+package com.microsoft.sqlserver.jdbc;
+
+import java.sql.CallableStatement;
+import java.sql.PreparedStatement;
+import java.sql.Statement;
+import java.util.UUID;
+
+/**
+ * This interface is implemented by {@link SQLServerConnection} and {@link SQLServerConnectionPoolProxy} Classes.
+ */
+public interface ISQLServerConnection extends java.sql.Connection {
+
+ // Transaction types.
+ // TRANSACTION_SNAPSHOT corresponds to -> SET TRANSACTION ISOLATION LEVEL SNAPSHOT
+ public final static int TRANSACTION_SNAPSHOT = 0x1000;
+
+ /**
+ * Gets the connection ID of the most recent connection attempt, regardless of whether the attempt succeeded or failed.
+ *
+ * @return 16-byte GUID representing the connection ID of the most recent connection attempt. Or, NULL if there is a failure after the connection
+ * request is initiated and the pre-login handshake.
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public UUID getClientConnectionId() throws SQLServerException;
+
+ /**
+ * Creates a Statement object that will generate ResultSet objects with the given type, concurrency, and holdability.
+ * This method is the same as the createStatement method above, but it allows the default result set type, concurrency, and
+ * holdability to be overridden.
+ *
+ * @param nType
+ * one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY,
+ * ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
+ * @param nConcur
+ * one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or
+ * ResultSet.CONCUR_UPDATABLE
+ * @param nHold
+ * one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or
+ * ResultSet.CLOSE_CURSORS_AT_COMMIT
+ * @param stmtColEncSetting
+ * Specifies how data will be sent and received when reading and writing encrypted columns.
+ * @return a new Statement object that will generate ResultSet objects with the given type, concurrency, and holdability
+ * @throws SQLServerException
+ * if a database access error occurs, this method is called on a closed connection or the given parameters are not
+ * ResultSet constants indicating type, concurrency, and holdability
+ */
+ public Statement createStatement(int nType,
+ int nConcur,
+ int nHold,
+ SQLServerStatementColumnEncryptionSetting stmtColEncSetting) throws SQLServerException;
+
+ /**
+ * Creates a default PreparedStatement object that has the capability to retrieve auto-generated keys. The given constant tells the
+ * driver whether it should make auto-generated keys available for retrieval. This parameter is ignored if the SQL statement is not an
+ * INSERT statement, or an SQL statement able to return auto-generated keys (the list of such statements is vendor-specific).
+ *
+ * Note: This method is optimized for handling parametric SQL statements that benefit from precompilation. If the driver supports
+ * precompilation, the method prepareStatement will send the statement to the database for precompilation. Some drivers may not
+ * support precompilation. In this case, the statement may not be sent to the database until the PreparedStatement object is
+ * executed. This has no direct effect on users; however, it does affect which methods throw certain SQLExceptions.
+ *
+ * Result sets created using the returned PreparedStatement object will by default be type TYPE_FORWARD_ONLY and have a
+ * concurrency level of CONCUR_READ_ONLY. The holdability of the created result sets can be determined by calling
+ * {@link #getHoldability}.
+ *
+ * @param sql
+ * an SQL statement that may contain one or more '?' IN parameter placeholders
+ * @param flag
+ * a flag indicating whether auto-generated keys should be returned; one of Statement.RETURN_GENERATED_KEYS or
+ * Statement.NO_GENERATED_KEYS
+ * @param stmtColEncSetting
+ * Specifies how data will be sent and received when reading and writing encrypted columns.
+ * @return a new PreparedStatement object, containing the pre-compiled SQL statement, that will have the capability of returning
+ * auto-generated keys
+ * @throws SQLServerException
+ * if a database access error occurs, this method is called on a closed connection or the given parameter is not a
+ * Statement constant indicating whether auto-generated keys should be returned
+ */
+ public PreparedStatement prepareStatement(String sql,
+ int flag,
+ SQLServerStatementColumnEncryptionSetting stmtColEncSetting) throws SQLServerException;
+
+ /**
+ * Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array. This array
+ * contains the indexes of the columns in the target table that contain the auto-generated keys that should be made available. The driver will
+ * ignore the array if the SQL statement is not an INSERT statement, or an SQL statement able to return auto-generated keys (the list
+ * of such statements is vendor-specific).
+ *
+ * An SQL statement with or without IN parameters can be pre-compiled and stored in a PreparedStatement object. This object can then
+ * be used to efficiently execute this statement multiple times.
+ *
+ * Note: This method is optimized for handling parametric SQL statements that benefit from precompilation. If the driver supports
+ * precompilation, the method prepareStatement will send the statement to the database for precompilation. Some drivers may not
+ * support precompilation. In this case, the statement may not be sent to the database until the PreparedStatement object is
+ * executed. This has no direct effect on users; however, it does affect which methods throw certain SQLExceptions.
+ *
+ * Result sets created using the returned PreparedStatement object will by default be type TYPE_FORWARD_ONLY and have a
+ * concurrency level of CONCUR_READ_ONLY. The holdability of the created result sets can be determined by calling
+ * {@link #getHoldability}.
+ *
+ * @param sql
+ * an SQL statement that may contain one or more '?' IN parameter placeholders
+ * @param columnIndexes
+ * an array of column indexes indicating the columns that should be returned from the inserted row or rows
+ * @param stmtColEncSetting
+ * Specifies how data will be sent and received when reading and writing encrypted columns.
+ * @return a new PreparedStatement object, containing the pre-compiled statement, that is capable of returning the auto-generated
+ * keys designated by the given array of column indexes
+ * @throws SQLServerException
+ * if a database access error occurs or this method is called on a closed connection
+ */
+ public PreparedStatement prepareStatement(String sql,
+ int[] columnIndexes,
+ SQLServerStatementColumnEncryptionSetting stmtColEncSetting) throws SQLServerException;
+
+ /**
+ * Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array. This array
+ * contains the names of the columns in the target table that contain the auto-generated keys that should be returned. The driver will ignore the
+ * array if the SQL statement is not an INSERT statement, or an SQL statement able to return auto-generated keys (the list of such
+ * statements is vendor-specific).
+ *
+ * An SQL statement with or without IN parameters can be pre-compiled and stored in a PreparedStatement object. This object can then
+ * be used to efficiently execute this statement multiple times.
+ *
+ * Note: This method is optimized for handling parametric SQL statements that benefit from precompilation. If the driver supports
+ * precompilation, the method prepareStatement will send the statement to the database for precompilation. Some drivers may not
+ * support precompilation. In this case, the statement may not be sent to the database until the PreparedStatement object is
+ * executed. This has no direct effect on users; however, it does affect which methods throw certain SQLExceptions.
+ *
+ * Result sets created using the returned PreparedStatement object will by default be type TYPE_FORWARD_ONLY and have a
+ * concurrency level of CONCUR_READ_ONLY. The holdability of the created result sets can be determined by calling
+ * {@link #getHoldability}.
+ *
+ * @param sql
+ * an SQL statement that may contain one or more '?' IN parameter placeholders
+ * @param columnNames
+ * an array of column names indicating the columns that should be returned from the inserted row or rows
+ * @param stmtColEncSetting
+ * Specifies how data will be sent and received when reading and writing encrypted columns.
+ * @return a new PreparedStatement object, containing the pre-compiled statement, that is capable of returning the auto-generated
+ * keys designated by the given array of column names
+ * @throws SQLServerException
+ * if a database access error occurs or this method is called on a closed connection
+ */
+ public PreparedStatement prepareStatement(String sql,
+ String[] columnNames,
+ SQLServerStatementColumnEncryptionSetting stmtColEncSetting) throws SQLServerException;
+
+ /**
+ * Creates a PreparedStatement object that will generate ResultSet objects with the given type, concurrency, and
+ * holdability.
+ *
+ * This method is the same as the prepareStatement method above, but it allows the default result set type, concurrency, and
+ * holdability to be overridden.
+ *
+ * @param sql
+ * a String object that is the SQL statement to be sent to the database; may contain one or more '?' IN parameters
+ * @param nType
+ * one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY,
+ * ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
+ * @param nConcur
+ * one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or
+ * ResultSet.CONCUR_UPDATABLE
+ * @param resultSetHoldability
+ * one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or
+ * ResultSet.CLOSE_CURSORS_AT_COMMIT
+ * @param stmtColEncSetting
+ * Specifies how data will be sent and received when reading and writing encrypted columns.
+ * @return a new PreparedStatement object, containing the pre-compiled SQL statement, that will generate ResultSet
+ * objects with the given type, concurrency, and holdability
+ * @throws SQLServerException
+ * if a database access error occurs, this method is called on a closed connection or the given parameters are not
+ * ResultSet constants indicating type, concurrency, and holdability
+ */
+ public PreparedStatement prepareStatement(java.lang.String sql,
+ int nType,
+ int nConcur,
+ int resultSetHoldability,
+ SQLServerStatementColumnEncryptionSetting stmtColEncSetting) throws SQLServerException;
+
+ /**
+ * Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency. This
+ * method is the same as the prepareCall method above, but it allows the default result set type, result set concurrency type and
+ * holdability to be overridden.
+ *
+ * @param sql
+ * a String object that is the SQL statement to be sent to the database; may contain on or more '?' parameters
+ * @param nType
+ * one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY,
+ * ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
+ * @param nConcur
+ * one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or
+ * ResultSet.CONCUR_UPDATABLE
+ * @param nHold
+ * one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or
+ * ResultSet.CLOSE_CURSORS_AT_COMMIT
+ * @param stmtColEncSetting
+ * Specifies how data will be sent and received when reading and writing encrypted columns.
+ * @return a new CallableStatement object, containing the pre-compiled SQL statement, that will generate ResultSet
+ * objects with the given type, concurrency, and holdability
+ * @throws SQLServerException
+ * if a database access error occurs, this method is called on a closed connection or the given parameters are not
+ * ResultSet constants indicating type, concurrency, and holdability
+ */
+ public CallableStatement prepareCall(String sql,
+ int nType,
+ int nConcur,
+ int nHold,
+ SQLServerStatementColumnEncryptionSetting stmtColEncSetting) throws SQLServerException;
+
+ /**
+ * Modifies the setting of the sendTimeAsDatetime connection property. When true, java.sql.Time values will be sent to the server as SQL
+ * Serverdatetime values. When false, java.sql.Time values will be sent to the server as SQL Servertime values. sendTimeAsDatetime can also be
+ * modified programmatically with SQLServerDataSource.setSendTimeAsDatetime. The default value for this property may change in a future release.
+ *
+ * @param sendTimeAsDateTimeValue
+ * enables/disables setting the sendTimeAsDatetime connection property. For more information about how the Microsoft JDBC Driver for
+ * SQL Server configures java.sql.Time values before sending them to the server, see
+ * Configuring How java.sql.Time Values are Sent to the
+ * Server.
+ *
+ * @throws SQLServerException
+ * if a database access error occurs
+ */
+ public void setSendTimeAsDatetime(boolean sendTimeAsDateTimeValue) throws SQLServerException;
+
+ /**
+ * Checks the sendTimeAsDatetime property.
+ *
+ * @return boolean value of sendTimeAsDatetime
+ *
+ * @throws SQLServerException
+ * if a database access error occurs
+ */
+ public boolean getSendTimeAsDatetime() throws SQLServerException;
+
+ /**
+ * Returns the number of currently outstanding prepared statement un-prepare actions.
+ *
+ * @return Returns the current value per the description.
+ */
+ public int getDiscardedServerPreparedStatementCount();
+
+ /**
+ * Forces the un-prepare requests for any outstanding discarded prepared statements to be executed.
+ */
+ public void closeUnreferencedPreparedStatementHandles();
+
+ /**
+ * Returns the behavior for a specific connection instance. If false the first execution will call sp_executesql and not prepare a statement, once
+ * the second execution happens it will call sp_prepexec and actually setup a prepared statement handle. Following executions will call
+ * sp_execute. This relieves the need for sp_unprepare on prepared statement close if the statement is only executed once. The default for this
+ * option can be changed by calling setDefaultEnablePrepareOnFirstPreparedStatementCall().
+ *
+ * @return Returns the current setting per the description.
+ */
+ public boolean getEnablePrepareOnFirstPreparedStatementCall();
+
+ /**
+ * Specifies the behavior for a specific connection instance. If value is false the first execution will call sp_executesql and not prepare a
+ * statement, once the second execution happens it will call sp_prepexec and actually setup a prepared statement handle. Following executions will
+ * call sp_execute. This relieves the need for sp_unprepare on prepared statement close if the statement is only executed once.
+ *
+ * @param value
+ * Changes the setting per the description.
+ */
+ public void setEnablePrepareOnFirstPreparedStatementCall(boolean value);
+
+ /**
+ * Returns the behavior for a specific connection instance. This setting controls how many outstanding prepared statement discard actions
+ * (sp_unprepare) can be outstanding per connection before a call to clean-up the outstanding handles on the server is executed. If the setting is
+ * {@literal <=} 1, unprepare actions will be executed immedietely on prepared statement close. If it is set to {@literal >} 1, these calls will
+ * be batched together to avoid overhead of calling sp_unprepare too often. The default for this option can be changed by calling
+ * getDefaultServerPreparedStatementDiscardThreshold().
+ *
+ * @return Returns the current setting per the description.
+ */
+ public int getServerPreparedStatementDiscardThreshold();
+
+ /**
+ * Specifies the behavior for a specific connection instance. This setting controls how many outstanding prepared statement discard actions
+ * (sp_unprepare) can be outstanding per connection before a call to clean-up the outstanding handles on the server is executed. If the setting is
+ * {@literal <=} 1 unprepare actions will be executed immedietely on prepared statement close. If it is set to {@literal >} 1 these calls will be
+ * batched together to avoid overhead of calling sp_unprepare too often.
+ *
+ * @param value
+ * Changes the setting per the description.
+ */
+ public void setServerPreparedStatementDiscardThreshold(int value);
+
+ /**
+ * Specifies the size of the prepared statement cache for this connection. A value less than 1 means no cache.
+ *
+ * @param value
+ * The new cache size.
+ *
+ */
+ public void setStatementPoolingCacheSize(int value);
+
+ /**
+ * Returns the size of the prepared statement cache for this connection. A value less than 1 means no cache.
+ *
+ * @return Returns the current setting per the description.
+ */
+ public int getStatementPoolingCacheSize();
+
+ /**
+ * Whether statement pooling is enabled or not for this connection.
+ *
+ * @return Returns the current setting per the description.
+ */
+ public boolean isStatementPoolingEnabled();
+
+ /**
+ * Returns the current number of pooled prepared statement handles.
+ *
+ * @return Returns the current setting per the description.
+ */
+ public int getStatementHandleCacheEntryCount();
+
+ /**
+ * Disable/enable statement pooling.
+ *
+ * @param value
+ * true to disable statement pooling, false to enable it.
+ */
+ public void setDisableStatementPooling(boolean value);
+
+ /**
+ * Determine whether statement pooling is disabled.
+ *
+ * @return true if statement pooling is disabled, false if it is enabled.
+ */
+ public boolean getDisableStatementPooling();
+}
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerConnection43.java b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerConnection43.java
index 1689cde87..c7dca8ee1 100644
--- a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerConnection43.java
+++ b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerConnection43.java
@@ -1,19 +1,59 @@
-package com.microsoft.sqlserver.jdbc;
-
-import java.sql.ShardingKey;
-
-public interface ISQLServerConnection43 extends ISQLServerConnection {
-
- public void setShardingKey(ShardingKey shardingKey) throws SQLServerException;
-
- public void setShardingKey(ShardingKey shardingKey,
- ShardingKey superShardingKey) throws SQLServerException;
-
- public boolean setShardingKeyIfValid(ShardingKey shardingKey,
- int timeout) throws SQLServerException;
-
- public boolean setShardingKeyIfValid(ShardingKey shardingKey,
- ShardingKey superShardingKey,
- int timeout) throws SQLServerException;
-
-}
+/*
+ * Microsoft JDBC Driver for SQL Server
+ *
+ * Copyright(c) Microsoft Corporation All rights reserved.
+ *
+ * This program is made available under the terms of the MIT License. See the LICENSE file in the project root for more information.
+ */
+
+package com.microsoft.sqlserver.jdbc;
+
+import java.sql.SQLException;
+
+/**
+ * This interface is implemented by {@link SQLServerConnection43} class.
+ */
+public interface ISQLServerConnection43 extends ISQLServerConnection {
+
+ /**
+ * Hints to the driver that a request, an independent unit of work, is beginning on this connection. It backs up the values of the connection
+ * properties that are modifiable through public methods. Each request is independent of all other requests with regard to state local to the
+ * connection either on the client or the server. Work done between {@code beginRequest}, {@code endRequest} pairs does not depend on any other
+ * work done on the connection either as part of another request or outside of any request. A request may include multiple transactions. There may
+ * be dependencies on committed database state as that is not local to the connection. {@code beginRequest} marks the beginning of the work unit.
+ *
+ * Local state is defined as any state associated with a Connection that is local to the current Connection either in the client or the database + * that is not transparently reproducible. + *
+ * Calls to {@code beginRequest} and {@code endRequest} are not nested. Multiple calls to {@code beginRequest} without an intervening call to + * {@code endRequest} is not an error. The first {@code beginRequest} call marks the start of the request and subsequent calls are treated as a + * no-op It is recommended to enclose each unit of work in {@code beginRequest}, {@code endRequest} pairs such that there is no open transaction + * at the beginning or end of the request and no dependency on local state that crosses request boundaries. Committed database state is not local. + * + * This method is to be used by Connection pooling managers. + *
+ * The pooling manager should call {@code beginRequest} on the underlying connection prior to returning a connection to the caller. + *
+ * + * @throws SQLException + * if an error occurs + * @see #endRequest() + */ + @Override + public void beginRequest() throws SQLException; + + /** + * Hints to the driver that a request, an independent unit of work, has completed. It rolls back the open transactions. Resets the connection + * properties that are modifiable through public methods back to their original values. Calls to {@code beginRequest} and {@code endRequest} are + * not nested. Multiple calls to {@code endRequest} without an intervening call to {@code beginRequest} is not an error. The first + * {@code endRequest} call marks the request completed and subsequent calls are treated as a no-op. If {@code endRequest} is called without an + * initial call to {@code beginRequest} is a no-op. This method is to be used by Connection pooling managers. + *
+ * + * @throws SQLException + * if an error occurs + * @see #beginRequest() + */ + @Override + public void endRequest() throws SQLException; +} diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerDataRecord.java b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerDataRecord.java index 79e109b7c..a4ee9f7cd 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerDataRecord.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerDataRecord.java @@ -1,49 +1,51 @@ -/* - * Microsoft JDBC Driver for SQL Server - * - * Copyright(c) Microsoft Corporation All rights reserved. - * - * This program is made available under the terms of the MIT License. See the LICENSE file in the project root for more information. - */ - -package com.microsoft.sqlserver.jdbc; - -/** - * The ISQLServerDataRecord interface can be used to create classes that read in data from any source (such as a file) and allow a structured type to - * be sent to SQL Server tables. - */ - -public interface ISQLServerDataRecord { - /** - * Get the column meta data - * - * @param column - * the first column is 1, the second is 2, and so on - * @return SQLServerMetaData of column - */ - public SQLServerMetaData getColumnMetaData(int column); - - /** - * Get the column count. - * - * @return Set of ordinals for the columns. - */ - public int getColumnCount(); - - /** - * Gets the data for the current row as an array of Objects. - * - * Each Object must match the Java language Type that is used to represent the indicated JDBC data type for the given column. For more - * information, see 'Understanding the JDBC Driver Data Types' for the appropriate mappings. - * - * @return The data for the row. - */ - public Object[] getRowData(); - - /** - * Advances to the next data row. - * - * @return True if rows are available; false if there are no more rows - */ - public boolean next(); -} +/* + * Microsoft JDBC Driver for SQL Server + * + * Copyright(c) Microsoft Corporation All rights reserved. + * + * This program is made available under the terms of the MIT License. See the LICENSE file in the project root for more information. + */ + +package com.microsoft.sqlserver.jdbc; + +/** + * This interface can be used to create classes that read in data from any + * source (such as a file) and allow a structured type to be sent to SQL Server + * tables. + */ +public interface ISQLServerDataRecord { + /** + * Get the column meta data + * + * @param column + * the first column is 1, the second is 2, and so on + * @return SQLServerMetaData of column + */ + public SQLServerMetaData getColumnMetaData(int column); + + /** + * Get the column count. + * + * @return Set of ordinals for the columns. + */ + public int getColumnCount(); + + /** + * Gets the data for the current row as an array of Objects. + * + * Each Object must match the Java language Type that is used to represent + * the indicated JDBC data type for the given column. For more information, + * see 'Understanding the JDBC Driver Data Types' for the appropriate + * mappings. + * + * @return The data for the row. + */ + public Object[] getRowData(); + + /** + * Advances to the next data row. + * + * @return True if rows are available; false if there are no more rows + */ + public boolean next(); +} diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerDataSource.java b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerDataSource.java index 492559244..08168cac1 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerDataSource.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerDataSource.java @@ -8,12 +8,15 @@ package com.microsoft.sqlserver.jdbc; -import javax.sql.CommonDataSource; +import org.ietf.jgss.GSSCredential; /** * A factory to create connections to the data source represented by this object. This interface was added in SQL Server JDBC Driver 3.0. + * + * This interface is implemented by {@link SQLServerDataSource} Class. */ -public interface ISQLServerDataSource extends CommonDataSource { +public interface ISQLServerDataSource extends javax.sql.CommonDataSource { + /** * Sets the application intent. * @@ -112,11 +115,36 @@ public interface ISQLServerDataSource extends CommonDataSource { */ public boolean getEncrypt(); + /** + * Beginning in version 6.0 of the Microsoft JDBC Driver for SQL Server, a new connection property transparentNetworkIPResolution (TNIR) is added + * for transparent connection to Always On availability groups or to a server which has multiple IP addresses associated. When + * transparentNetworkIPResolution is true, the driver attempts to connect to the first IP address available. If the first attempt fails, the + * driver tries to connect to all IP addresses in parallel until the timeout expires, discarding any pending connection attempts when one of them + * succeeds. + *
+ * transparentNetworkIPResolution is ignored if multiSubnetFailover is true + *
+ * transparentNetworkIPResolution is ignored if database mirroring is used + *
+ * transparentNetworkIPResolution is ignored if there are more than 64 IP addresses
+ *
+ * @param tnir
+ * if set to true, the driver attempts to connect to the first IP address available. It is true by default.
+ */
+ public void setTransparentNetworkIPResolution(boolean tnir);
+
+ /**
+ * Retrieves the TransparentNetworkIPResolution value.
+ *
+ * @return if enabled, returns true. Otherwise, false.
+ */
+ public boolean getTransparentNetworkIPResolution();
+
/**
* Sets a Boolean value that indicates if the trustServerCertificate property is enabled.
*
* @param e
- * true if the server Secure Sockets Layer (SSL) certificate should be automatically trusted when the communication layer is encrypted
+ * true, if the server Secure Sockets Layer (SSL) certificate should be automatically trusted when the communication layer is encrypted
* using SSL. Otherwise, false.
*/
public void setTrustServerCertificate(boolean e);
@@ -128,36 +156,51 @@ public interface ISQLServerDataSource extends CommonDataSource {
*/
public boolean getTrustServerCertificate();
+ /**
+ * This parameter defines the keystore type for the trustStore.
+ *
+ * @param trustStoreType
+ * A String that contains the trust store type
+ */
+ public void setTrustStoreType(String trustStoreType);
+
+ /**
+ * Returns the keyStore Type for the trustStore
+ *
+ * @return trustStoreType A String that contains the trust store type
+ */
+ public String getTrustStoreType();
+
/**
* Sets the path (including file name) to the certificate trustStore file.
*
- * @param st
+ * @param trustStore
* A String that contains the path (including file name) to the certificate trustStore file.
*/
- public void setTrustStore(String st);
+ public void setTrustStore(String trustStore);
/**
* Returns the path (including file name) to the certificate trustStore file.
*
- * @return A String that contains the path (including file name) to the certificate trustStore file, or null if no value is set.
+ * @return trustStore A String that contains the path (including file name) to the certificate trustStore file, or null if no value is set.
*/
public String getTrustStore();
/**
* Sets the password that is used to check the integrity of the trustStore data.
*
- * @param p
+ * @param trustStorePassword
* A String that contains the password that is used to check the integrity of the trustStore data.
*/
- public void setTrustStorePassword(String p);
+ public void setTrustStorePassword(String trustStorePassword);
/**
* Sets the host name to be used in validating the SQL Server Secure Sockets Layer (SSL) certificate.
*
- * @param host
+ * @param hostName
* A String that contains the host name.
*/
- public void setHostNameInCertificate(String host);
+ public void setHostNameInCertificate(String hostName);
/**
* Returns the host name used in validating the SQL Server Secure Sockets Layer (SSL) certificate.
@@ -222,11 +265,11 @@ public interface ISQLServerDataSource extends CommonDataSource {
/**
* Sets the response buffering mode for connections created by using this SQLServerDataSource object.
*
- * @param respo
+ * @param bufferingMode
* A String that contains the buffering and streaming mode. The valid mode can be one of the following case-insensitive Strings: full
* or adaptive.
*/
- public void setResponseBuffering(String respo);
+ public void setResponseBuffering(String bufferingMode);
/**
* Returns the response buffering mode for this SQLServerDataSource object.
@@ -267,6 +310,21 @@ public interface ISQLServerDataSource extends CommonDataSource {
*/
public boolean getSendStringParametersAsUnicode();
+ /**
+ * Translates the serverName from Unicode to ASCII Compatible Encoding (ACE)
+ *
+ * @param serverNameAsACE
+ * if enabled the servername will be translated to ASCII Compatible Encoding (ACE)
+ */
+ public void setServerNameAsACE(boolean serverNameAsACE);
+
+ /**
+ * Retrieves if the serverName should be translated from Unicode to ASCII Compatible Encoding (ACE)
+ *
+ * @return if enabled, will return true. Otherwise, false.
+ */
+ public boolean getServerNameAsACE();
+
/**
* Sets the name of the computer that is running SQL Server.
*
@@ -410,6 +468,21 @@ public interface ISQLServerDataSource extends CommonDataSource {
*/
public void setAuthenticationScheme(String authenticationScheme);
+ /**
+ * sets the authentication mode
+ *
+ * @param authentication
+ * the authentication mode
+ */
+ public void setAuthentication(String authentication);
+
+ /**
+ * Retrieves the authentication mode
+ *
+ * @return the authentication value
+ */
+ public String getAuthentication();
+
/**
* Sets the server spn
*
@@ -424,4 +497,297 @@ public interface ISQLServerDataSource extends CommonDataSource {
* @return A String that contains the server spn
*/
public String getServerSpn();
+
+ /**
+ * sets GSSCredential
+ *
+ * @param userCredential
+ * the credential
+ */
+ public void setGSSCredentials(GSSCredential userCredential);
+
+ /**
+ * Retrieves the GSSCredential
+ *
+ * @return GSSCredential
+ */
+ public GSSCredential getGSSCredentials();
+
+ /**
+ * Sets the access token.
+ *
+ * @param accessToken
+ * to be set in the string property.
+ */
+ public void setAccessToken(String accessToken);
+
+ /**
+ * Retrieves the access token.
+ *
+ * @return the access token.
+ */
+ public String getAccessToken();
+
+ /**
+ * Enables/disables Always Encrypted functionality for the data source object. The default is Disabled.
+ *
+ * @param columnEncryptionSetting
+ * Enables/disables Always Encrypted functionality for the data source object. The default is Disabled.
+ */
+ public void setColumnEncryptionSetting(String columnEncryptionSetting);
+
+ /**
+ * Retrieves the Always Encrypted functionality setting for the data source object.
+ *
+ * @return the Always Encrypted functionality setting for the data source object.
+ */
+ public String getColumnEncryptionSetting();
+
+ /**
+ * Sets the name that identifies a key store. Only value supported is the "JavaKeyStorePassword" for identifying the Java Key Store. The default
+ * is null.
+ *
+ * @param keyStoreAuthentication
+ * the name that identifies a key store.
+ */
+ public void setKeyStoreAuthentication(String keyStoreAuthentication);
+
+ /**
+ * Gets the value of the keyStoreAuthentication setting for the data source object.
+ *
+ * @return the value of the keyStoreAuthentication setting for the data source object.
+ */
+ public String getKeyStoreAuthentication();
+
+ /**
+ * Sets the password for the Java keystore. Note that, for Java Key Store provider the password for the keystore and the key must be the same.
+ * Note that, keyStoreAuthentication must be set with "JavaKeyStorePassword".
+ *
+ * @param keyStoreSecret
+ * the password to use for the keystore as well as for the key
+ */
+ public void setKeyStoreSecret(String keyStoreSecret);
+
+ /**
+ * Sets the location including the file name for the Java keystore. Note that, keyStoreAuthentication must be set with "JavaKeyStorePassword".
+ *
+ * @param keyStoreLocation
+ * the location including the file name for the Java keystore.
+ */
+ public void setKeyStoreLocation(String keyStoreLocation);
+
+ /**
+ * Retrieves the keyStoreLocation for the Java Key Store.
+ *
+ * @return the keyStoreLocation for the Java Key Store.
+ */
+ public String getKeyStoreLocation();
+
+ /**
+ * Setting the query timeout
+ *
+ * @param queryTimeout
+ * The number of seconds to wait before a timeout has occurred on a query. The default value is 0, which means infinite timeout.
+ */
+ public void setQueryTimeout(int queryTimeout);
+
+ /**
+ * Getting the query timeout
+ *
+ * @return The number of seconds to wait before a timeout has occurred on a query.
+ */
+ public int getQueryTimeout();
+
+ /**
+ * Setting the cancel timeout
+ *
+ * @param cancelQueryTimeout
+ * The number of seconds to wait before we wait for the query timeout to happen.
+ */
+ public void setCancelQueryTimeout(int cancelQueryTimeout);
+
+ /**
+ * Getting the cancel timeout
+ *
+ * @return the number of seconds to wait before we wait for the query timeout to happen.
+ */
+ public int getCancelQueryTimeout();
+
+ /**
+ * If this configuration is false the first execution of a prepared statement will call sp_executesql and not prepare a statement, once the second
+ * execution happens it will call sp_prepexec and actually setup a prepared statement handle. Following executions will call sp_execute. This
+ * relieves the need for sp_unprepare on prepared statement close if the statement is only executed once.
+ *
+ * @param enablePrepareOnFirstPreparedStatementCall
+ * Changes the setting per the description.
+ */
+ public void setEnablePrepareOnFirstPreparedStatementCall(boolean enablePrepareOnFirstPreparedStatementCall);
+
+ /**
+ * If this configuration returns false the first execution of a prepared statement will call sp_executesql and not prepare a statement, once the
+ * second execution happens it will call sp_prepexec and actually setup a prepared statement handle. Following executions will call sp_execute.
+ * This relieves the need for sp_unprepare on prepared statement close if the statement is only executed once.
+ *
+ * @return Returns the current setting per the description.
+ */
+ public boolean getEnablePrepareOnFirstPreparedStatementCall();
+
+ /**
+ * This setting controls how many outstanding prepared statement discard actions (sp_unprepare) can be outstanding per connection before a call to
+ * clean-up the outstanding handles on the server is executed. If the setting is {@literal <=} 1 unprepare actions will be executed immedietely on
+ * prepared statement close. If it is set to {@literal >} 1 these calls will be batched together to avoid overhead of calling sp_unprepare too
+ * often.
+ *
+ * @param serverPreparedStatementDiscardThreshold
+ * Changes the setting per the description.
+ */
+ public void setServerPreparedStatementDiscardThreshold(int serverPreparedStatementDiscardThreshold);
+
+ /**
+ * This setting controls how many outstanding prepared statement discard actions (sp_unprepare) can be outstanding per connection before a call to
+ * clean-up the outstanding handles on the server is executed. If the setting is {@literal <=} 1 unprepare actions will be executed immedietely on
+ * prepared statement close. If it is set to {@literal >} 1 these calls will be batched together to avoid overhead of calling sp_unprepare too
+ * often.
+ *
+ * @return Returns the current setting per the description.
+ */
+ public int getServerPreparedStatementDiscardThreshold();
+
+ /**
+ * Specifies the size of the prepared statement cache for this connection. A value less than 1 means no cache.
+ *
+ * @param statementPoolingCacheSize
+ * Changes the setting per the description.
+ */
+ public void setStatementPoolingCacheSize(int statementPoolingCacheSize);
+
+ /**
+ * Returns the size of the prepared statement cache for this connection. A value less than 1 means no cache.
+ *
+ * @return Returns the current setting per the description.
+ */
+ public int getStatementPoolingCacheSize();
+
+ /**
+ * Disable/enable statement pooling.
+ *
+ * @param disableStatementPooling
+ * true to disable statement pooling, false to enable it.
+ */
+ public void setDisableStatementPooling(boolean disableStatementPooling);
+
+ /**
+ * Determine whether statement pooling is disabled.
+ *
+ * @return true if statement pooling is disabled, false if it is enabled.
+ */
+ public boolean getDisableStatementPooling();
+
+ /**
+ * Setting the socket timeout
+ *
+ * @param socketTimeout
+ * The number of milliseconds to wait before a timeout is occurred on a socket read or accept. The default value is 0, which means
+ * infinite timeout.
+ */
+ public void setSocketTimeout(int socketTimeout);
+
+ /**
+ * Getting the socket timeout
+ *
+ * @return The number of milliseconds to wait before a timeout is occurred on a socket read or accept.
+ */
+ public int getSocketTimeout();
+
+ /**
+ * Sets the login configuration file for Kerberos authentication. This overrides the default configuration SQLJDBCDriver
+ *
+ * @param configurationName
+ * the configuration name
+ */
+ public void setJASSConfigurationName(String configurationName);
+
+ /**
+ * Retrieves the login configuration file for Kerberos authentication.
+ *
+ * @return login configuration file name
+ */
+ public String getJASSConfigurationName();
+
+ /**
+ * Enables Fips Mode on the connection For FIPS enabled JVM this property should be true.
+ *
+ * @param fips
+ * Boolean property to enable/disable fips
+ */
+ public void setFIPS(boolean fips);
+
+ /**
+ * Retrieves value of connection property "fips" For FIPS enabled JVM this property should be true.
+ *
+ * @return fips boolean value
+ */
+ public boolean getFIPS();
+
+ /**
+ * Sets the sslProtocol property for connection Set this value to specify TLS protocol keyword.
+ *
+ * Acceptable values are: TLS, TLSv1, TLSv1.1, and TLSv1.2.
+ *
+ * @param sslProtocol
+ * Value for SSL Protocol to be set.
+ */
+ public void setSSLProtocol(String sslProtocol);
+
+ /**
+ * Retrieves value of connection property 'sslProtocol'
+ *
+ * @return sslProtocol property value
+ */
+ public String getSSLProtocol();
+
+ /**
+ * Sets the connection property 'trustManagerClass' on the connection
+ *
+ * @param trustManagerClass
+ * The fully qualified class name of a custom javax.net.ssl.TrustManager.
+ */
+ public void setTrustManagerClass(String trustManagerClass);
+
+ /**
+ * Retrieves value for the connection property 'trustManagerClass'
+ *
+ * @return trustManagerClass property value
+ */
+ public String getTrustManagerClass();
+
+ /**
+ * Sets Constructor Arguments to be provided on constructor of 'trustManagerClass'
+ *
+ * @param trustManagerConstructorArg
+ * 'trustManagerClass' constructor arguments
+ */
+ public void setTrustManagerConstructorArg(String trustManagerConstructorArg);
+
+ /**
+ * Retrieves value for the connection property 'trustManagerConstructorArg'
+ *
+ * @return trustManagerConstructorArg property value
+ */
+ public String getTrustManagerConstructorArg();
+
+ /**
+ * Getting the use Bulk Copy API for Batch Insert
+ *
+ * @return whether the driver should use Bulk Copy API for Batch Insert operations.
+ */
+ public boolean getUseBulkCopyForBatchInsert();
+
+ /**
+ * Setting the use Bulk Copy API for Batch Insert
+ *
+ * @param useBulkCopyForBatchInsert
+ * indicates whether Bulk Copy API should be used for Batch Insert operations.
+ */
+ public void setUseBulkCopyForBatchInsert(boolean useBulkCopyForBatchInsert);
}
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerPreparedStatement.java b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerPreparedStatement.java
index ee954f151..17fc6b558 100644
--- a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerPreparedStatement.java
+++ b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerPreparedStatement.java
@@ -8,8 +8,14 @@
package com.microsoft.sqlserver.jdbc;
-import java.sql.SQLException;
+import java.math.BigDecimal;
+import java.sql.ParameterMetaData;
+import java.sql.ResultSet;
+import java.sql.SQLType;
+/**
+ * This interface is implemented by {@link SQLServerPreparedStatement} class.
+ */
public interface ISQLServerPreparedStatement extends java.sql.PreparedStatement, ISQLServerStatement {
/**
* Sets the designated parameter to the given microsoft.sql.DateTimeOffset value.
@@ -18,10 +24,819 @@ public interface ISQLServerPreparedStatement extends java.sql.PreparedStatement,
* the first parameter is 1, the second is 2, ...
* @param x
* the parameter value
- * @throws SQLException
+ * @throws SQLServerException
* if parameterIndex does not correspond to a parameter marker in the SQL statement; if a database access error occurs or this method
* is called on a closed PreparedStatement
*/
public void setDateTimeOffset(int parameterIndex,
- microsoft.sql.DateTimeOffset x) throws SQLException;
+ microsoft.sql.DateTimeOffset x) throws SQLServerException;
+
+ /**
+ * Sets the value of the designated parameter with the given object.
+ *
+ * This method is similar to {@link #setObject(int parameterIndex, Object x, SQLType targetSqlType, int scaleOrLength)}, except that it assumes a
+ * scale of zero.
+ *
+ * The default implementation will throw {@code SQLFeatureNotSupportedException} + * + * @param parameterIndex + * the first parameter is 1, the second is 2, ... + * @param x + * the object containing the input parameter value + * @param targetSqlType + * the SQL type to be sent to the database + * @param precision + * the precision of the column + * @param scale + * the scale of the column + * @throws SQLServerException + * if parameterIndex does not correspond to a parameter marker in the SQL statement; if a database access error occurs or this method + * is called on a closed {@code PreparedStatement} + */ + public void setObject(int parameterIndex, + Object x, + SQLType targetSqlType, + Integer precision, + Integer scale) throws SQLServerException; + + /** + * Sets the value of the designated parameter with the given object. + * + * This method is similar to {@link #setObject(int parameterIndex, Object x, SQLType targetSqlType, int scaleOrLength)}, except that it assumes a + * scale of zero. + *
+ * The default implementation will throw {@code SQLFeatureNotSupportedException}
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the object containing the input parameter value
+ * @param targetSqlType
+ * the SQL type to be sent to the database
+ * @param precision
+ * the precision of the column
+ * @param scale
+ * the scale of the column
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * if parameterIndex does not correspond to a parameter marker in the SQL statement; if a database access error occurs or this method
+ * is called on a closed {@code PreparedStatement}
+ */
+ public void setObject(int parameterIndex,
+ Object x,
+ SQLType targetSqlType,
+ Integer precision,
+ Integer scale,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * The server handle for this prepared statement. If a value {@literal <} 1 is returned no handle has been created.
+ *
+ * @return Per the description.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public int getPreparedStatementHandle() throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.math.BigDecimal value. The driver converts this to an SQL NUMERIC
+ * value when it sends it to the database.
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @param precision
+ * the precision of the column
+ * @param scale
+ * the scale of the column
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setBigDecimal(int parameterIndex,
+ BigDecimal x,
+ int precision,
+ int scale) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.math.BigDecimal value. The driver converts this to an SQL NUMERIC
+ * value when it sends it to the database.
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @param precision
+ * the precision of the column
+ * @param scale
+ * the scale of the column
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setBigDecimal(int parameterIndex,
+ BigDecimal x,
+ int precision,
+ int scale,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.math.BigDecimal value. The driver converts this to an SQL NUMERIC
+ * value when it sends it to the database.
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setMoney(int parameterIndex,
+ BigDecimal x) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.math.BigDecimal value. The driver converts this to an SQL NUMERIC
+ * value when it sends it to the database.
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setMoney(int parameterIndex,
+ BigDecimal x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.math.BigDecimal value. The driver converts this to an SQL NUMERIC
+ * value when it sends it to the database.
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setSmallMoney(int parameterIndex,
+ BigDecimal x) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.math.BigDecimal value. The driver converts this to an SQL NUMERIC
+ * value when it sends it to the database.
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setSmallMoney(int parameterIndex,
+ BigDecimal x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given Java boolean value. The driver converts this to an SQL BIT or
+ * BOOLEAN value when it sends it to the database.
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setBoolean(int parameterIndex,
+ boolean x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given Java byte value. The driver converts this to an SQL TINYINT value when it
+ * sends it to the database.
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setByte(int parameterIndex,
+ byte x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given Java array of bytes. The driver converts this to an SQL VARBINARY or
+ * LONGVARBINARY (depending on the argument's size relative to the driver's limits on VARBINARY values) when it sends it
+ * to the database.
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setBytes(int parameterIndex,
+ byte x[],
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given String. The driver converts this to an SQL GUID
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param guid
+ * string representation of the uniqueIdentifier value
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setUniqueIdentifier(int parameterIndex,
+ String guid) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given String. The driver converts this to an SQL GUID
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param guid
+ * string representation of the uniqueIdentifier value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setUniqueIdentifier(int parameterIndex,
+ String guid,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given Java double value. The driver converts this to an SQL DOUBLE value when it
+ * sends it to the database.
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setDouble(int parameterIndex,
+ double x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given Java float value. The driver converts this to an SQL REAL value when it
+ * sends it to the database.
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setFloat(int parameterIndex,
+ float x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given microsoft.sql.Geometry Class object. The driver converts this to an SQL
+ * REAL value when it sends it to the database.
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setGeometry(int parameterIndex,
+ Geometry x) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given microsoft.sql.Geography Class object. The driver converts this to an SQL
+ * REAL value when it sends it to the database.
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setGeography(int parameterIndex,
+ Geography x) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given Java int value. The driver converts this to an SQL INTEGER value when it
+ * sends it to the database.
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param value
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setInt(int parameterIndex,
+ int value,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given Java long value. The driver converts this to an SQL BIGINT value when it
+ * sends it to the database.
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setLong(int parameterIndex,
+ long x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ *
+ * Sets the value of the designated parameter with the given object. + * + *
+ * The given Java object will be converted to the given targetSqlType before being sent to the database.
+ *
+ * If the object has a custom mapping (is of a class implementing the interface SQLData), the JDBC driver should call the method
+ * SQLData.writeSQL to write it to the SQL data stream. If, on the other hand, the object is of a class implementing
+ * Ref, Blob, Clob, NClob, Struct, java.net.URL, or
+ * Array, 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. + * + * @param parameterIndex + * the first parameter is 1, the second is 2, ... + * @param x + * the object containing the input parameter value + * @param targetSqlType + * the SQL type (as defined in java.sql.Types) to be sent to the database. The scale argument may further qualify this type. + * @param precision + * the precision of the column + * @param scale + * scale of the column + * @throws SQLServerException + * when an error occurs + */ + public void setObject(int parameterIndex, + Object x, + int targetSqlType, + Integer precision, + int scale) throws SQLServerException; + + /** + *
+ * Sets the value of the designated parameter with the given object. + * + *
+ * The given Java object will be converted to the given targetSqlType before being sent to the database.
+ *
+ * If the object has a custom mapping (is of a class implementing the interface SQLData), the JDBC driver should call the method
+ * SQLData.writeSQL to write it to the SQL data stream. If, on the other hand, the object is of a class implementing
+ * Ref, Blob, Clob, NClob, Struct, java.net.URL, or
+ * Array, 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.
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the object containing the input parameter value
+ * @param targetSqlType
+ * the SQL type (as defined in java.sql.Types) to be sent to the database. The scale argument may further qualify this type.
+ * @param precision
+ * the precision of the column
+ * @param scale
+ * scale of the column
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setObject(int parameterIndex,
+ Object x,
+ int targetSqlType,
+ Integer precision,
+ int scale,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given Java short value. The driver converts this to an SQL SMALLINT value when
+ * it sends it to the database.
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setShort(int parameterIndex,
+ short x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given Java String value. The driver converts this to an SQL VARCHAR or
+ * LONGVARCHAR value (depending on the argument's size relative to the driver's limits on VARCHAR values) when it sends
+ * it to the database.
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param str
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setString(int parameterIndex,
+ String str,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given String object. The driver converts this to a SQL NCHAR or
+ * NVARCHAR or LONGNVARCHAR value (depending on the argument's size relative to the driver's limits on
+ * NVARCHAR values) when it sends it to the database.
+ *
+ * @param parameterIndex
+ * of the first parameter is 1, the second is 2, ...
+ * @param value
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setNString(int parameterIndex,
+ String value,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.sql.Time value
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @param scale
+ * the scale of the column
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setTime(int parameterIndex,
+ java.sql.Time x,
+ int scale) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.sql.Time value
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @param scale
+ * the scale of the column
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setTime(int parameterIndex,
+ java.sql.Time x,
+ int scale,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.sql.Timestamp value
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @param scale
+ * the scale of the column
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setTimestamp(int parameterIndex,
+ java.sql.Timestamp x,
+ int scale) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.sql.Timestamp value
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @param scale
+ * the scale of the column
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setTimestamp(int parameterIndex,
+ java.sql.Timestamp x,
+ int scale,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given microsoft.sql.DatetimeOffset value
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @param scale
+ * the scale of the column
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setDateTimeOffset(int parameterIndex,
+ microsoft.sql.DateTimeOffset x,
+ int scale) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given microsoft.sql.DatetimeOffset value
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @param scale
+ * the scale of the column
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setDateTimeOffset(int parameterIndex,
+ microsoft.sql.DateTimeOffset x,
+ int scale,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.sql.Timestamp value
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setDateTime(int parameterIndex,
+ java.sql.Timestamp x) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.sql.Timestamp value
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setDateTime(int parameterIndex,
+ java.sql.Timestamp x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.sql.Timestamp value
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setSmallDateTime(int parameterIndex,
+ java.sql.Timestamp x) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.sql.Timestamp value
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setSmallDateTime(int parameterIndex,
+ java.sql.Timestamp x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Populates a table valued parameter with a data table
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param tvpName
+ * the name of the table valued parameter
+ * @param tvpDataTable
+ * the source datatable object
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setStructured(int parameterIndex,
+ String tvpName,
+ SQLServerDataTable tvpDataTable) throws SQLServerException;
+
+ /**
+ * Populates a table valued parameter with a data table
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param tvpName
+ * the name of the table valued parameter
+ * @param tvpResultSet
+ * the source resultset object
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setStructured(int parameterIndex,
+ String tvpName,
+ ResultSet tvpResultSet) throws SQLServerException;
+
+ /**
+ * Populates a table valued parameter with a data table
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param tvpName
+ * the name of the table valued parameter
+ * @param tvpBulkRecord
+ * an ISQLServerDataRecord object
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setStructured(int parameterIndex,
+ String tvpName,
+ ISQLServerDataRecord tvpBulkRecord) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.sql.Date value, using the given Calendar object. The driver uses the
+ * Calendar object to construct an SQL DATE value, which the driver then sends to the database. With a
+ * Calendar object, the driver can calculate the date taking into account a custom timezone. If no Calendar object is
+ * specified, the driver uses the default timezone, which is that of the virtual machine running the application.
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @param cal
+ * the Calendar object the driver will use to construct the date
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setDate(int parameterIndex,
+ java.sql.Date x,
+ java.util.Calendar cal,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.sql.Time value. The driver converts this to an SQL TIME value when it
+ * sends it to the database.
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @param cal
+ * the Calendar object the driver will use to construct the date
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setTime(int parameterIndex,
+ java.sql.Time x,
+ java.util.Calendar cal,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Sets the designated parameter to the given java.sql.Timestamp value. The driver converts this to an SQL TIMESTAMP
+ * value when it sends it to the database.
+ *
+ * @param parameterIndex
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * the parameter value
+ * @param cal
+ * the Calendar object the driver will use to construct the date
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void setTimestamp(int parameterIndex,
+ java.sql.Timestamp x,
+ java.util.Calendar cal,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Returns parameter metadata for the prepared statement.
+ *
+ * @param forceRefresh:
+ * If true the cache will not be used to retrieve the metadata.
+ *
+ * @return Per the description.
+ *
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public ParameterMetaData getParameterMetaData(boolean forceRefresh) throws SQLServerException;
+
}
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerPreparedStatement42.java b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerPreparedStatement42.java
deleted file mode 100644
index 229af83ee..000000000
--- a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerPreparedStatement42.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Microsoft JDBC Driver for SQL Server
- *
- * Copyright(c) Microsoft Corporation All rights reserved.
- *
- * This program is made available under the terms of the MIT License. See the LICENSE file in the project root for more information.
- */
-
-package com.microsoft.sqlserver.jdbc;
-
-import java.sql.SQLType;
-
-/**
- * This interface requires all the PreparedStatement methods including those are specific to JDBC 4.2
- *
- */
-public interface ISQLServerPreparedStatement42 extends ISQLServerPreparedStatement {
-
- public void setObject(int index,
- Object obj,
- SQLType jdbcType) throws SQLServerException;
-
- public void setObject(int parameterIndex,
- Object x,
- SQLType targetSqlType,
- int scaleOrLength) throws SQLServerException;
-
- /**
- * Sets the value of the designated parameter with the given object.
- *
- * This method is similar to {@link #setObject(int parameterIndex, Object x, SQLType targetSqlType, int scaleOrLength)}, except that it assumes a
- * scale of zero.
- *
- * The default implementation will throw {@code SQLFeatureNotSupportedException} - * - * @param parameterIndex - * the first parameter is 1, the second is 2, ... - * @param x - * the object containing the input parameter value - * @param targetSqlType - * the SQL type to be sent to the database - * @param precision - * the precision of the column - * @param scale - * the scale of the column - * @throws SQLServerException - * if parameterIndex does not correspond to a parameter marker in the SQL statement; if a database access error occurs or this method - * is called on a closed {@code PreparedStatement} - */ - public void setObject(int parameterIndex, - Object x, - SQLType targetSqlType, - Integer precision, - Integer scale) throws SQLServerException; - - /** - * Sets the value of the designated parameter with the given object. - * - * This method is similar to {@link #setObject(int parameterIndex, Object x, SQLType targetSqlType, int scaleOrLength)}, except that it assumes a - * scale of zero. - *
- * The default implementation will throw {@code SQLFeatureNotSupportedException}
- *
- * @param parameterIndex
- * the first parameter is 1, the second is 2, ...
- * @param x
- * the object containing the input parameter value
- * @param targetSqlType
- * the SQL type to be sent to the database
- * @param precision
- * the precision of the column
- * @param scale
- * the scale of the column
- * @param forceEncrypt
- * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
- * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
- * encryption on parameters.
- * @throws SQLServerException
- * if parameterIndex does not correspond to a parameter marker in the SQL statement; if a database access error occurs or this method
- * is called on a closed {@code PreparedStatement}
- */
- public void setObject(int parameterIndex,
- Object x,
- SQLType targetSqlType,
- Integer precision,
- Integer scale,
- boolean forceEncrypt) throws SQLServerException;
-}
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerResultSet.java b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerResultSet.java
index d0bab83cf..e9fa6ccb6 100644
--- a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerResultSet.java
+++ b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerResultSet.java
@@ -8,8 +8,15 @@
package com.microsoft.sqlserver.jdbc;
-import java.sql.SQLException;
+import java.math.BigDecimal;
+import java.sql.SQLType;
+import java.util.Calendar;
+import com.microsoft.sqlserver.jdbc.dataclassification.SensitivityClassification;
+
+/**
+ * This interface is implemented by {@link SQLServerResultSet} class.
+ */
public interface ISQLServerResultSet extends java.sql.ResultSet {
public static final int TYPE_SS_DIRECT_FORWARD_ONLY = 2003; // TYPE_FORWARD_ONLY + 1000
@@ -23,16 +30,195 @@ public interface ISQLServerResultSet extends java.sql.ResultSet {
public static final int CONCUR_SS_SCROLL_LOCKS = 1009; // CONCUR_UPDATABLE + 1
public static final int CONCUR_SS_OPTIMISTIC_CCVAL = 1010; // CONCUR_UPDATABLE + 2
+ /**
+ * Retrieves the value of the designated column in the current row of this ResultSet object as a com.microsoft.sqlserver.jdbc.Geometry object in
+ * the Java programming language.
+ *
+ * @param columnIndex
+ * the first column is 1, the second is 2, ...
+ * @return the column value; if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public Geometry getGeometry(int columnIndex) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the designated column in the current row of this ResultSet object as a com.microsoft.sqlserver.jdbc.Geometry object in
+ * the Java programming language.
+ *
+ * @param columnName
+ * the name of the column
+ * @return the column value; if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public Geometry getGeometry(String columnName) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the designated column in the current row of this ResultSet object as a com.microsoft.sqlserver.jdbc.Geography object in
+ * the Java programming language.
+ *
+ * @param columnIndex
+ * the first column is 1, the second is 2, ...
+ * @return the column value; if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public Geography getGeography(int columnIndex) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the designated column in the current row of this ResultSet object as a com.microsoft.sqlserver.jdbc.Geography object in
+ * the Java programming language.
+ *
+ * @param columnName
+ * the name of the column
+ * @return the column value; if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public Geography getGeography(String columnName) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the designated column in the current row of this ResultSet object as a String object in the Java programming language.
+ *
+ * @param columnIndex
+ * the first column is 1, the second is 2, ...
+ * @return the column value; if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public String getUniqueIdentifier(int columnIndex) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the designated column in the current row of this ResultSet object as a String object in the Java programming language.
+ *
+ * @param columnLabel
+ * the name of the column
+ * @return the column value; if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public String getUniqueIdentifier(String columnLabel) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming
+ * language.
+ *
+ * @param columnIndex
+ * the first column is 1, the second is 2, ...
+ * @return the column value; if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public java.sql.Timestamp getDateTime(int columnIndex) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming
+ * language.
+ *
+ * @param columnName
+ * is the name of the column
+ * @return the column value; if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public java.sql.Timestamp getDateTime(String columnName) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming
+ * language. This method uses the given calendar to construct an appropriate millisecond value for the timestamp if the underlying database does
+ * not store timezone information.
+ *
+ * @param columnIndex
+ * the first column is 1, the second is 2, ...
+ * @param cal
+ * the java.util.Calendar object to use in constructing the dateTime
+ * @return the column value; if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public java.sql.Timestamp getDateTime(int columnIndex,
+ Calendar cal) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming
+ * language. This method uses the given calendar to construct an appropriate millisecond value for the timestamp if the underlying database does
+ * not store timezone information.
+ *
+ * @param colName
+ * the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the
+ * column
+ * @param cal
+ * the java.util.Calendar object to use in constructing the dateTime
+ * @return the column value; if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public java.sql.Timestamp getDateTime(String colName,
+ Calendar cal) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming
+ * language.
+ *
+ * @param columnIndex
+ * the first column is 1, the second is 2, ...
+ * @return the column value; if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public java.sql.Timestamp getSmallDateTime(int columnIndex) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming
+ * language.
+ *
+ * @param columnName
+ * is the name of a column.
+ * @return the column value; if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public java.sql.Timestamp getSmallDateTime(String columnName) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming
+ * language.
+ *
+ * @param columnIndex
+ * the first column is 1, the second is 2, ...
+ * @param cal
+ * the java.util.Calendar object to use in constructing the smalldateTime
+ * @return the column value; if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public java.sql.Timestamp getSmallDateTime(int columnIndex,
+ Calendar cal) throws SQLServerException;
+
+ /**
+ *
+ * @param colName
+ * The name of a column
+ * @param cal
+ * the java.util.Calendar object to use in constructing the smalldateTime
+ * @return the column value; if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public java.sql.Timestamp getSmallDateTime(String colName,
+ Calendar cal) throws SQLServerException;
+
/**
* Retrieves the value of the designated column as a microsoft.sql.DateTimeOffset object, given a zero-based column ordinal.
*
* @param columnIndex
* The zero-based ordinal of a column.
* @return A DateTimeOffset Class object.
- * @throws SQLException
+ * @throws SQLServerException
* when an error occurs
*/
- public microsoft.sql.DateTimeOffset getDateTimeOffset(int columnIndex) throws SQLException;
+ public microsoft.sql.DateTimeOffset getDateTimeOffset(int columnIndex) throws SQLServerException;
/**
* Retrieves the value of the column specified as a microsoft.sql.DateTimeOffset object, given a column name.
@@ -40,10 +226,54 @@ public interface ISQLServerResultSet extends java.sql.ResultSet {
* @param columnName
* The name of a column.
* @return A DateTimeOffset Class object.
- * @throws SQLException
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public microsoft.sql.DateTimeOffset getDateTimeOffset(String columnName) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the column specified as a java.math.BigDecimal object.
+ *
+ * @param columnIndex
+ * The zero-based ordinal of a column.
+ * @return the column value; if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
* when an error occurs
*/
- public microsoft.sql.DateTimeOffset getDateTimeOffset(String columnName) throws SQLException;
+ public BigDecimal getMoney(int columnIndex) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the column specified as a java.math.BigDecimal object.
+ *
+ * @param columnName
+ * is the name of a column.
+ * @return the column value; if the value is SQL NULL, the value returned is null.
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public BigDecimal getMoney(String columnName) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the column specified as a java.math.BigDecimal object.
+ *
+ * @param columnIndex
+ * The zero-based ordinal of a column.
+ * @return the column value; if the value is SQL NULL, the value returned is null
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public BigDecimal getSmallMoney(int columnIndex) throws SQLServerException;
+
+ /**
+ * Retrieves the value of the column specified as a java.math.BigDecimal object.
+ *
+ * @param columnName
+ * is the name of a column.
+ * @return the column value; if the value is SQL NULL, the value returned is null.
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public BigDecimal getSmallMoney(String columnName) throws SQLServerException;
/**
* Updates the value of the column specified to the DateTimeOffset Class value, given a zero-based column ordinal.
@@ -52,11 +282,11 @@ public interface ISQLServerResultSet extends java.sql.ResultSet {
* The zero-based ordinal of a column.
* @param x
* A DateTimeOffset Class object.
- * @throws SQLException
+ * @throws SQLServerException
* when an error occurs
*/
public void updateDateTimeOffset(int index,
- microsoft.sql.DateTimeOffset x) throws SQLException;
+ microsoft.sql.DateTimeOffset x) throws SQLServerException;
/**
* Updates the value of the column specified to the DateTimeOffset Class value, given a column name.
@@ -65,10 +295,1408 @@ public void updateDateTimeOffset(int index,
* The name of a column.
* @param x
* A DateTimeOffset Class object.
- * @throws SQLException
+ * @throws SQLServerException
* when an error occurs
*/
public void updateDateTimeOffset(String columnName,
- microsoft.sql.DateTimeOffset x) throws SQLException;
+ microsoft.sql.DateTimeOffset x) throws SQLServerException;
+
+ /**
+ * Updates the designated column with an {@code Object} value.
+ *
+ * The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying
+ * database; instead the {@code updateRow} or {@code insertRow} methods are called to update the database.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param x
+ * the new column value
+ * @param precision
+ * the precision of the column
+ * @param scale
+ * the scale of the column
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateObject(int index,
+ Object x,
+ int precision,
+ int scale) throws SQLServerException;
+
+ /**
+ * Updates the designated column with an Object value. The updater methods are used to update column values in the current row or the insert row.
+ * The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database. If the
+ * second argument is an InputStream then the stream must contain the number of bytes specified by scaleOrLength. If the second argument is a
+ * Reader then the reader must contain the number of characters specified by scaleOrLength. If these conditions are not true the driver will
+ * generate a SQLServerException when the statement is executed. The default implementation will throw SQLFeatureNotSupportedException
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param obj
+ * the new column value
+ * @param targetSqlType
+ * the SQL type to be sent to the database
+ * @param scale
+ * for an object of java.math.BigDecimal , this is the number of digits after the decimal point. For Java Object types InputStream and
+ * Reader, this is the length of the data in the stream or reader. For all other types, this value will be ignored.
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement.If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateObject(int index,
+ Object obj,
+ SQLType targetSqlType,
+ int scale,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ *
+ * Updates the designated column with an Object value. The updater methods are used to update column values in the current row or the insert row.
+ * The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database. If the
+ * second argument is an InputStream then the stream must contain the number of bytes specified by scaleOrLength. If the second argument is a
+ * Reader then the reader must contain the number of characters specified by scaleOrLength. If these conditions are not true the driver will
+ * generate a SQLServerException when the statement is executed. The default implementation will throw SQLFeatureNotSupportedException
+ *
+ * @param columnName
+ * the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the
+ * column
+ * @param obj
+ * the new column value
+ * @param targetSqlType
+ * the SQL type to be sent to the database
+ * @param scale
+ * for an object of java.math.BigDecimal , this is the number of digits after the decimal point. For Java Object types InputStream and
+ * Reader, this is the length of the data in the stream or reader. For all other types, this value will be ignored.
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement.If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateObject(String columnName,
+ Object obj,
+ SQLType targetSqlType,
+ int scale,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a boolean value. The updater methods are used to update column values in the current row or the
+ * insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are
+ * called to update the database.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param x
+ * the new column value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateBoolean(int index,
+ boolean x,
+ boolean forceEncrypt) throws SQLServerException;
+ /**
+ * Updates the designated column with a byte value. The updater methods are used to update column values in the current row or the
+ * insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are
+ * called to update the database.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param x
+ * the new column value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateByte(int index,
+ byte x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a short value. The updater methods are used to update column values in the current row or the
+ * insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are
+ * called to update the database.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param x
+ * the new column value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateShort(int index,
+ short x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with an int value. The updater methods are used to update column values in the current row or the
+ * insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are
+ * called to update the database.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param x
+ * the new column value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateInt(int index,
+ int x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a long value. The updater methods are used to update column values in the current row or the
+ * insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are
+ * called to update the database.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param x
+ * the new column value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateLong(int index,
+ long x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a float value. The updater methods are used to update column values in the current row or the
+ * insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are
+ * called to update the database.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param x
+ * the new column value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateFloat(int index,
+ float x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a double value. The updater methods are used to update column values in the current row or the
+ * insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are
+ * called to update the database.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param x
+ * the new column value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateDouble(int index,
+ double x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a money value. The updater methods are used to update column values in the current row or the
+ * insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are
+ * called to update the database.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param x
+ * the new column value
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateMoney(int index,
+ BigDecimal x) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a money value. The updater methods are used to update column values in the current row or the
+ * insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are
+ * called to update the database.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param x
+ * the new column value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateMoney(int index,
+ BigDecimal x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a money value. The updater methods are used to update column values in the current row or the
+ * insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are
+ * called to update the database.
+ *
+ * @param columnName
+ * the column name
+ * @param x
+ * the new column value
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateMoney(String columnName,
+ BigDecimal x) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a money value. The updater methods are used to update column values in the current row or the
+ * insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are
+ * called to update the database.
+ *
+ * @param columnName
+ * the column name
+ * @param x
+ * the new column value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateMoney(String columnName,
+ BigDecimal x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a smallmoney value. The updater methods are used to update column values in the current row or
+ * the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods
+ * are called to update the database.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param x
+ * the new column value
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateSmallMoney(int index,
+ BigDecimal x) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a smallmoney value. The updater methods are used to update column values in the current row or
+ * the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods
+ * are called to update the database.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param x
+ * the new column value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateSmallMoney(int index,
+ BigDecimal x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a smallmoney value. The updater methods are used to update column values in the current row or
+ * the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods
+ * are called to update the database.
+ *
+ * @param columnName
+ * the column name
+ * @param x
+ * the new column value
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateSmallMoney(String columnName,
+ BigDecimal x) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a smallmoney value. The updater methods are used to update column values in the current row or
+ * the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods
+ * are called to update the database.
+ *
+ * @param columnName
+ * the column name
+ * @param x
+ * the new column value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateSmallMoney(String columnName,
+ BigDecimal x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a java.math.BigDecimal value. The updater methods are used to update column values in the
+ * current row or the insert row. The updater methods do not update the underlying database; instead the updateRow or
+ * insertRow methods are called to update the database.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param x
+ * the new column value
+ * @param precision
+ * the precision of the column
+ * @param scale
+ * the scale of the column
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateBigDecimal(int index,
+ BigDecimal x,
+ Integer precision,
+ Integer scale) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a java.math.BigDecimal value. The updater methods are used to update column values in the
+ * current row or the insert row. The updater methods do not update the underlying database; instead the updateRow or
+ * insertRow methods are called to update the database.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param x
+ * the new column value
+ * @param precision
+ * the precision of the column
+ * @param scale
+ * the scale of the column
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateBigDecimal(int index,
+ BigDecimal x,
+ Integer precision,
+ Integer scale,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a String value. The updater methods are used to update column values in the current row or the
+ * insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are
+ * called to update the database.
+ *
+ * @param columnIndex
+ * the first column is 1, the second is 2, ...
+ * @param stringValue
+ * the new column value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateString(int columnIndex,
+ String stringValue,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a String value. It is intended for use when updating NCHAR,NVARCHAR
+ * and LONGNVARCHAR columns. The updater methods are used to update column values in the current row or the insert row. The updater
+ * methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the
+ * database.
+ *
+ * @param columnIndex
+ * the first column is 1, the second 2, ...
+ * @param nString
+ * the value for the column to be updated
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateNString(int columnIndex,
+ String nString,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a String value. It is intended for use when updating NCHAR,NVARCHAR
+ * and LONGNVARCHAR columns. The updater methods are used to update column values in the current row or the insert row. The updater
+ * methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the
+ * database.
+ *
+ * @param columnLabel
+ * the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the
+ * column
+ * @param nString
+ * the value for the column to be updated
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateNString(String columnLabel,
+ String nString,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a byte array value. The updater methods are used to update column values in the current row or
+ * the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods
+ * are called to update the database.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param x
+ * the new column value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateBytes(int index,
+ byte x[],
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a java.sql.Date value. The updater methods are used to update column values in the current row
+ * or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow
+ * methods are called to update the database.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param x
+ * the new column value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateDate(int index,
+ java.sql.Date x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a java.sql.Time value. The updater methods are used to update column values in the current row
+ * or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow
+ * methods are called to update the database.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param x
+ * the new column value
+ * @param scale
+ * the scale of the column
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateTime(int index,
+ java.sql.Time x,
+ Integer scale) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a java.sql.Time value. The updater methods are used to update column values in the current row
+ * or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow
+ * methods are called to update the database.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param x
+ * the new column value
+ * @param scale
+ * the scale of the column
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateTime(int index,
+ java.sql.Time x,
+ Integer scale,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a java.sql.Timestamp value. The updater methods are used to update column values in the current
+ * row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow
+ * methods are called to update the database.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param x
+ * the new column value
+ * @param scale
+ * the scale of the column
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateTimestamp(int index,
+ java.sql.Timestamp x,
+ int scale) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a java.sql.Timestamp value. The updater methods are used to update column values in the current
+ * row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow
+ * methods are called to update the database.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param x
+ * the new column value
+ * @param scale
+ * the scale of the column
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateTimestamp(int index,
+ java.sql.Timestamp x,
+ int scale,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a java.sql.Timestamp value. The updater methods are used to update column values in the current
+ * row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow
+ * methods are called to update the database.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param x
+ * the new column value
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateDateTime(int index,
+ java.sql.Timestamp x) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a java.sql.Timestamp value. The updater methods are used to update column values in the current
+ * row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow
+ * methods are called to update the database.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param x
+ * the new column value
+ * @param scale
+ * the scale of the column
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateDateTime(int index,
+ java.sql.Timestamp x,
+ Integer scale) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a java.sql.Timestamp value. The updater methods are used to update column values in the current
+ * row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow
+ * methods are called to update the database.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param x
+ * the new column value
+ * @param scale
+ * the scale of the column
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateDateTime(int index,
+ java.sql.Timestamp x,
+ Integer scale,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a java.sql.Timestamp value. The updater methods are used to update column values in the current
+ * row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow
+ * methods are called to update the database.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param x
+ * the new column value
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateSmallDateTime(int index,
+ java.sql.Timestamp x) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a java.sql.Timestamp value. The updater methods are used to update column values in the current
+ * row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow
+ * methods are called to update the database.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param x
+ * the new column value
+ * @param scale
+ * the scale of the column
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateSmallDateTime(int index,
+ java.sql.Timestamp x,
+ Integer scale) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a java.sql.Timestamp value. The updater methods are used to update column values in the current
+ * row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow
+ * methods are called to update the database.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param x
+ * the new column value
+ * @param scale
+ * the scale of the column
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateSmallDateTime(int index,
+ java.sql.Timestamp x,
+ Integer scale,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the value of the column specified to the DateTimeOffset Class value, given a zero-based column ordinal.
+ *
+ * @param index
+ * The zero-based ordinal of a column.
+ * @param x
+ * A DateTimeOffset Class object.
+ * @param scale
+ * scale of the column
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateDateTimeOffset(int index,
+ microsoft.sql.DateTimeOffset x,
+ Integer scale) throws SQLServerException;
+
+ /**
+ * Updates the value of the column specified to the DateTimeOffset Class value, given a zero-based column ordinal.
+ *
+ * @param index
+ * The zero-based ordinal of a column.
+ * @param x
+ * A DateTimeOffset Class object.
+ * @param scale
+ * scale of the column
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateDateTimeOffset(int index,
+ microsoft.sql.DateTimeOffset x,
+ Integer scale,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a String value. The updater methods are used to update column values in the current row or the
+ * insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are
+ * called to update the database.
+ *
+ * @param index
+ * The zero-based ordinal of a column.
+ * @param x
+ * the new column value
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateUniqueIdentifier(int index,
+ String x) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a String value. The updater methods are used to update column values in the current row or the
+ * insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are
+ * called to update the database.
+ *
+ * @param index
+ * The zero-based ordinal of a column.
+ * @param x
+ * the new column value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateUniqueIdentifier(int index,
+ String x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with an {@code Object} value.
+ *
+ * The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying
+ * database; instead the {@code updateRow} or {@code insertRow} methods are called to update the database.
+ *
+ * @param index
+ * the first column is 1, the second is 2, ...
+ * @param x
+ * the new column value
+ * @param precision
+ * the precision of the column
+ * @param scale
+ * the scale of the column
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateObject(int index,
+ Object x,
+ int precision,
+ int scale,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a boolean value. The updater methods are used to update column values in the current row or the
+ * insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are
+ * called to update the database.
+ *
+ * @param columnName
+ * the name of the column
+ * @param x
+ * the new column value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public void updateBoolean(String columnName,
+ boolean x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a byte value. The updater methods are used to update column values in the current row or the
+ * insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are
+ * called to update the database.
+ *
+ *
+ * @param columnName
+ * the name of the column
+ * @param x
+ * the new column value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateByte(String columnName,
+ byte x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a short value. The updater methods are used to update column values in the current row or the
+ * insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are
+ * called to update the database.
+ *
+ * @param columnName
+ * the name of the column
+ * @param x
+ * the new column value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateShort(String columnName,
+ short x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with an int value. The updater methods are used to update column values in the current row or the
+ * insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are
+ * called to update the database.
+ *
+ * @param columnName
+ * is the name of the column
+ * @param x
+ * the new column value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateInt(String columnName,
+ int x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a long value. The updater methods are used to update column values in the current row or the
+ * insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are
+ * called to update the database.
+ *
+ * @param columnName
+ * is the name of the column
+ * @param x
+ * the new column value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateLong(String columnName,
+ long x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a float value. The updater methods are used to update column values in the current row or the
+ * insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are
+ * called to update the database.
+ *
+ * @param columnName
+ * is the name of the column
+ * @param x
+ * the new column value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateFloat(String columnName,
+ float x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a double value. The updater methods are used to update column values in the current row or the
+ * insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are
+ * called to update the database.
+ *
+ * @param columnName
+ * is the name of the column
+ * @param x
+ * the new column value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateDouble(String columnName,
+ double x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a java.sql.BigDecimal value. The updater methods are used to update column values in the
+ * current row or the insert row. The updater methods do not update the underlying database; instead the updateRow or
+ * insertRow methods are called to update the database.
+ *
+ * @param columnName
+ * is the name of the column
+ * @param x
+ * the new column value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateBigDecimal(String columnName,
+ BigDecimal x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a java.sql.BigDecimal value. The updater methods are used to update column values in the
+ * current row or the insert row. The updater methods do not update the underlying database; instead the updateRow or
+ * insertRow methods are called to update the database.
+ *
+ * @param columnName
+ * is the name of the column 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.
+ * @param x
+ * BigDecimal value
+ * @param precision
+ * the precision of the column
+ * @param scale
+ * the scale of the column
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateBigDecimal(String columnName,
+ BigDecimal x,
+ Integer precision,
+ Integer scale) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a java.sql.BigDecimal value. The updater methods are used to update column values in the
+ * current row or the insert row. The updater methods do not update the underlying database; instead the updateRow or
+ * insertRow methods are called to update the database.
+ *
+ * @param columnName
+ * is the name of the column 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.
+ * @param x
+ * BigDecimal value
+ * @param precision
+ * the precision of the column
+ * @param scale
+ * the scale of the column
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateBigDecimal(String columnName,
+ BigDecimal x,
+ Integer precision,
+ Integer scale,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a String value. The updater methods are used to update column values in the current row or the
+ * insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are
+ * called to update the database.
+ *
+ * @param columnName
+ * is the name of the column
+ * @param x
+ * the new column value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateString(String columnName,
+ String x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a byte array value.
+ *
+ * The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying
+ * database; instead the updateRow or insertRow methods are called to update the database.
+ *
+ * @param columnName
+ * is the name of the column
+ * @param x
+ * the new column value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateBytes(String columnName,
+ byte x[],
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a java.sql.Date value. The updater methods are used to update column values in the current row
+ * or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow
+ * methods are called to update the database.
+ *
+ * @param columnName
+ * is the name of the column
+ * @param x
+ * the new column value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateDate(String columnName,
+ java.sql.Date x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a java.sql.Time value. The updater methods are used to update column values in the current row
+ * or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow
+ * methods are called to update the database.
+ *
+ * @param columnName
+ * is the name of the column
+ * @param x
+ * the new column value
+ * @param scale
+ * the scale of the column
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateTime(String columnName,
+ java.sql.Time x,
+ int scale) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a java.sql.Time value. The updater methods are used to update column values in the current row
+ * or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow
+ * methods are called to update the database.
+ *
+ * @param columnName
+ * is the name of the column
+ * @param x
+ * the new column value
+ * @param scale
+ * the scale of the column
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateTime(String columnName,
+ java.sql.Time x,
+ int scale,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a java.sql.Timestamp value. The updater methods are used to update column values in the current
+ * row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow
+ * methods are called to update the database.
+ *
+ * @param columnName
+ * is the name of the column
+ * @param x
+ * the new column value
+ * @param scale
+ * the scale of the column
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateTimestamp(String columnName,
+ java.sql.Timestamp x,
+ int scale) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a java.sql.Timestamp value. The updater methods are used to update column values in the current
+ * row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow
+ * methods are called to update the database.
+ *
+ * @param columnName
+ * is the name of the column
+ * @param x
+ * the new column value
+ * @param scale
+ * the scale of the column
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateTimestamp(String columnName,
+ java.sql.Timestamp x,
+ int scale,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a java.sql.Timestamp value. The updater methods are used to update column values in the current
+ * row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow
+ * methods are called to update the database.
+ *
+ * @param columnName
+ * is the name of the column
+ * @param x
+ * the new column value
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateDateTime(String columnName,
+ java.sql.Timestamp x) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a java.sql.Timestamp value. The updater methods are used to update column values in the current
+ * row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow
+ * methods are called to update the database.
+ *
+ * @param columnName
+ * is the name of the column
+ * @param x
+ * the new column value
+ * @param scale
+ * the scale of the column
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateDateTime(String columnName,
+ java.sql.Timestamp x,
+ int scale) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a java.sql.Timestamp value. The updater methods are used to update column values in the current
+ * row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow
+ * methods are called to update the database.
+ *
+ * @param columnName
+ * is the name of the column
+ * @param x
+ * the new column value
+ * @param scale
+ * the scale of the column
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateDateTime(String columnName,
+ java.sql.Timestamp x,
+ int scale,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a java.sql.Timestamp value. The updater methods are used to update column values in the current
+ * row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow
+ * methods are called to update the database.
+ *
+ * @param columnName
+ * is the name of the column
+ * @param x
+ * the new column value
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateSmallDateTime(String columnName,
+ java.sql.Timestamp x) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a java.sql.Timestamp value. The updater methods are used to update column values in the current
+ * row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow
+ * methods are called to update the database.
+ *
+ * @param columnName
+ * is the name of the column
+ * @param x
+ * the new column value
+ * @param scale
+ * the scale of the column
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateSmallDateTime(String columnName,
+ java.sql.Timestamp x,
+ int scale) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a java.sql.Timestamp value. The updater methods are used to update column values in the current
+ * row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow
+ * methods are called to update the database.
+ *
+ * @param columnName
+ * is the name of the column
+ * @param x
+ * the new column value
+ * @param scale
+ * the scale of the column
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateSmallDateTime(String columnName,
+ java.sql.Timestamp x,
+ int scale,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the value of the column specified to the DateTimeOffset Class value, given a column name.
+ *
+ * @param columnName
+ * The name of a column.
+ * @param x
+ * A DateTimeOffset Class object.
+ * @param scale
+ * the scale of the column
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateDateTimeOffset(String columnName,
+ microsoft.sql.DateTimeOffset x,
+ int scale) throws SQLServerException;
+
+ /**
+ * Updates the value of the column specified to the DateTimeOffset Class value, given a column name.
+ *
+ * @param columnName
+ * The name of a column.
+ * @param x
+ * A DateTimeOffset Class object.
+ * @param scale
+ * the scale of the column
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateDateTimeOffset(String columnName,
+ microsoft.sql.DateTimeOffset x,
+ int scale,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a Stringvalue. The updater methods are used to update column values in the current row or the
+ * insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are
+ * called to update the database.
+ *
+ * @param columnName
+ * The name of a column.
+ * @param x
+ * the new column value
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateUniqueIdentifier(String columnName,
+ String x) throws SQLServerException;
+
+ /**
+ * Updates the designated column with a Stringvalue. The updater methods are used to update column values in the current row or the
+ * insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are
+ * called to update the database.
+ *
+ * @param columnName
+ * The name of a column.
+ * @param x
+ * the new column value
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateUniqueIdentifier(String columnName,
+ String x,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Updates the designated column with an {@code Object} value.
+ *
+ * The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying
+ * database; instead the {@code updateRow} or {@code insertRow} methods are called to update the database.
+ *
+ * @param columnName
+ * The name of a column.
+ * @param x
+ * the new column value
+ * @param precision
+ * the precision of the column
+ * @param scale
+ * the scale of the column
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateObject(String columnName,
+ Object x,
+ int precision,
+ int scale) throws SQLServerException;
+
+ /**
+ * Updates the designated column with an {@code Object} value.
+ *
+ * The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying
+ * database; instead the {@code updateRow} or {@code insertRow} methods are called to update the database.
+ *
+ * @param columnName
+ * The name of a column.
+ * @param x
+ * the new column value
+ * @param precision
+ * the precision of the column
+ * @param scale
+ * the scale of the column
+ * @param forceEncrypt
+ * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
+ * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
+ * encryption on parameters.
+ * @throws SQLServerException
+ * If any errors occur.
+ */
+ public void updateObject(String columnName,
+ Object x,
+ int precision,
+ int scale,
+ boolean forceEncrypt) throws SQLServerException;
+
+ /**
+ * Exposes Data Classification information for the current ResultSet For SQL Servers that do not support Data Classification or results that do
+ * not fetch any classified columns, this data can be null
+ *
+ * @return SensitivityClassification
+ */
+ public SensitivityClassification getSensitivityClassification();
}
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerResultSet42.java b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerResultSet42.java
deleted file mode 100644
index 1f75ec99f..000000000
--- a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerResultSet42.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Microsoft JDBC Driver for SQL Server
- *
- * Copyright(c) Microsoft Corporation All rights reserved.
- *
- * This program is made available under the terms of the MIT License. See the LICENSE file in the project root for more information.
- */
-
-package com.microsoft.sqlserver.jdbc;
-
-import java.sql.SQLType;
-
-/**
- * This interface requires all the ResultSet methods including those are specific to JDBC 4.2
- *
- */
-public interface ISQLServerResultSet42 extends ISQLServerResultSet {
-
- public void updateObject(int index,
- Object obj,
- SQLType targetSqlType) throws SQLServerException;
-
- public void updateObject(int index,
- Object obj,
- SQLType targetSqlType,
- int scale) throws SQLServerException;
-
- /**
- * Updates the designated column with an Object value. The updater methods are used to update column values in the current row or the insert row.
- * The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database. If the
- * second argument is an InputStream then the stream must contain the number of bytes specified by scaleOrLength. If the second argument is a
- * Reader then the reader must contain the number of characters specified by scaleOrLength. If these conditions are not true the driver will
- * generate a SQLException when the statement is executed. The default implementation will throw SQLFeatureNotSupportedException
- *
- * @param index
- * the first column is 1, the second is 2, ...
- * @param obj
- * the new column value
- * @param targetSqlType
- * the SQL type to be sent to the database
- * @param scale
- * for an object of java.math.BigDecimal , this is the number of digits after the decimal point. For Java Object types InputStream and
- * Reader, this is the length of the data in the stream or reader. For all other types, this value will be ignored.
- * @param forceEncrypt
- * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
- * Encrypted is enabled on the connection or on the statement.If the boolean forceEncrypt is set to false, the driver will not force
- * encryption on parameters.
- * @throws SQLServerException
- * If any errors occur.
- */
- public void updateObject(int index,
- Object obj,
- SQLType targetSqlType,
- int scale,
- boolean forceEncrypt) throws SQLServerException;
-
- public void updateObject(String columnName,
- Object obj,
- SQLType targetSqlType,
- int scale) throws SQLServerException;
-
- /**
- *
- * Updates the designated column with an Object value. The updater methods are used to update column values in the current row or the insert row.
- * The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database. If the
- * second argument is an InputStream then the stream must contain the number of bytes specified by scaleOrLength. If the second argument is a
- * Reader then the reader must contain the number of characters specified by scaleOrLength. If these conditions are not true the driver will
- * generate a SQLException when the statement is executed. The default implementation will throw SQLFeatureNotSupportedException
- *
- * @param columnName
- * the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the
- * column
- * @param obj
- * the new column value
- * @param targetSqlType
- * the SQL type to be sent to the database
- * @param scale
- * for an object of java.math.BigDecimal , this is the number of digits after the decimal point. For Java Object types InputStream and
- * Reader, this is the length of the data in the stream or reader. For all other types, this value will be ignored.
- * @param forceEncrypt
- * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
- * Encrypted is enabled on the connection or on the statement.If the boolean forceEncrypt is set to false, the driver will not force
- * encryption on parameters.
- * @throws SQLServerException
- * If any errors occur.
- */
- public void updateObject(String columnName,
- Object obj,
- SQLType targetSqlType,
- int scale,
- boolean forceEncrypt) throws SQLServerException;
-
- public void updateObject(String columnName,
- Object obj,
- SQLType targetSqlType) throws SQLServerException;
-}
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerResultSetMetaData.java b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerResultSetMetaData.java
new file mode 100644
index 000000000..25f88d733
--- /dev/null
+++ b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerResultSetMetaData.java
@@ -0,0 +1,29 @@
+/*
+ * Microsoft JDBC Driver for SQL Server
+ *
+ * Copyright(c) Microsoft Corporation All rights reserved.
+ *
+ * This program is made available under the terms of the MIT License. See the LICENSE file in the project root for more information.
+ */
+
+package com.microsoft.sqlserver.jdbc;
+
+import java.sql.ResultSetMetaData;
+
+/**
+ * This interface is implemented by {@link SQLServerResultSetMetaData} class.
+ */
+public interface ISQLServerResultSetMetaData extends ResultSetMetaData {
+
+ /**
+ * Returns true if the column is a SQLServer SparseColumnSet
+ *
+ * @param column
+ * The column number
+ * @return true if a column in a result set is a sparse column set, otherwise false.
+ * @throws SQLServerException
+ * when an error occurs
+ */
+ public boolean isSparseColumnSet(int column) throws SQLServerException;
+
+}
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerSavepoint.java b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerSavepoint.java
new file mode 100644
index 000000000..4fd4dbb1a
--- /dev/null
+++ b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerSavepoint.java
@@ -0,0 +1,39 @@
+/*
+ * Microsoft JDBC Driver for SQL Server
+ *
+ * Copyright(c) Microsoft Corporation All rights reserved.
+ *
+ * This program is made available under the terms of the MIT License. See the LICENSE file in the project root for more information.
+ */
+
+package com.microsoft.sqlserver.jdbc;
+
+import java.sql.Savepoint;
+
+/**
+ * This interface is implemented by {@link SQLServerSavepoint} class.
+ */
+public interface ISQLServerSavepoint extends Savepoint {
+
+ /**
+ * Get the savepoint name
+ *
+ * @return the name of savepoint
+ */
+ public String getSavepointName() throws SQLServerException;
+
+ /**
+ * Get the savepoint label
+ *
+ * @return the label for Savepoint
+ */
+ public String getLabel();
+
+ /**
+ * Checks if the savepoint label is null
+ *
+ * @return true is the savepoint is named. Otherwise, false.
+ */
+ public boolean isNamed();
+
+}
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerStatement.java b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerStatement.java
index 518a74cb2..a1ba642a7 100644
--- a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerStatement.java
+++ b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerStatement.java
@@ -1,39 +1,62 @@
-/*
- * Microsoft JDBC Driver for SQL Server
- *
- * Copyright(c) Microsoft Corporation All rights reserved.
- *
- * This program is made available under the terms of the MIT License. See the LICENSE file in the project root for more information.
- */
-
-package com.microsoft.sqlserver.jdbc;
-
-public interface ISQLServerStatement extends java.sql.Statement {
- /**
- * Sets the response buffering mode for this SQLServerStatement object to case-insensitive String full or adaptive.
- *
- * Response buffering controls the driver's buffering of responses from SQL Server. - *
- * Possible values are: - *
- * "full" - Fully buffer the response at execution time. - *
- * "adaptive" - Data Pipe adaptive buffering - * - * @param value - * A String that contains the response buffering mode. The valid mode can be one of the following case-insensitive Strings: full or - * adaptive. - * @throws SQLServerException - * If there are any errors in setting the response buffering mode. - */ - public void setResponseBuffering(String value) throws SQLServerException; - - /** - * Retrieves the response buffering mode for this SQLServerStatement object. - * - * @return A String that contains a lower-case full or adaptive. - * @throws SQLServerException - * If there are any errors in retrieving the response buffering mode. - */ - public String getResponseBuffering() throws SQLServerException; -} +/* + * Microsoft JDBC Driver for SQL Server + * + * Copyright(c) Microsoft Corporation All rights reserved. + * + * This program is made available under the terms of the MIT License. See the LICENSE file in the project root for more information. + */ + +package com.microsoft.sqlserver.jdbc; + +/** + * This interface is implemented by {@link SQLServerStatement} class. + */ +public interface ISQLServerStatement extends java.sql.Statement { + /** + * Sets the response buffering mode for this SQLServerStatement object to case-insensitive String full or adaptive. + *
+ * Response buffering controls the driver's buffering of responses from SQL Server. + *
+ * Possible values are: + *
+ * "full" - Fully buffer the response at execution time. + *
+ * "adaptive" - Data Pipe adaptive buffering
+ *
+ * @param value
+ * A String that contains the response buffering mode. The valid mode can be one of the following case-insensitive Strings: full or
+ * adaptive.
+ * @throws SQLServerException
+ * If there are any errors in setting the response buffering mode.
+ */
+ public void setResponseBuffering(String value) throws SQLServerException;
+
+ /**
+ * Retrieves the response buffering mode for this SQLServerStatement object.
+ *
+ * @return A String that contains a lower-case full or adaptive.
+ * @throws SQLServerException
+ * If there are any errors in retrieving the response buffering mode.
+ */
+ public String getResponseBuffering() throws SQLServerException;
+
+ /**
+ * Retrieves the
- * After free() has been called, any attempt to invoke a method other than free() will result in a SQLException being thrown. If free() is called
- * multiple times, the subsequent calls to free are treated as a no-op.
- */
+ @Override
public void free() throws SQLException {
if (!isClosed) {
- // Close active streams, ignoring any errors, since nothing can be done with them after that point anyway.
+ // Close active streams, ignoring any errors, since nothing can be
+ // done with them after that point anyway.
if (null != activeStreams) {
for (Closeable stream : activeStreams) {
try {
@@ -123,7 +124,6 @@ public void free() throws SQLException {
// Discard the value
value = null;
-
isClosed = true;
}
}
@@ -138,9 +138,9 @@ private void checkClosed() throws SQLServerException {
}
}
+ @Override
public InputStream getBinaryStream() throws SQLException {
checkClosed();
-
if (null == value && !activeStreams.isEmpty()) {
InputStream stream = (InputStream) activeStreams.get(0);
try {
@@ -159,10 +159,11 @@ public InputStream getBinaryStream() throws SQLException {
}
}
+ @Override
public InputStream getBinaryStream(long pos,
long length) throws SQLException {
- // Not implemented - partial materialization
- throw new SQLFeatureNotSupportedException(SQLServerException.getErrString("R_notSupported"));
+ SQLServerException.throwFeatureNotSupportedException();
+ return null;
}
private InputStream getBinaryStreamInternal(int pos,
@@ -177,19 +178,7 @@ private InputStream getBinaryStreamInternal(int pos,
return getterStream;
}
- /**
- * Retrieves all or part of the BLOB value that this Blob object represents, as an array of bytes. This byte array contains up to length
- * consecutive bytes starting at position pos.
- *
- * @param pos
- * - the ordinal position of the first byte in the BLOB value to be extracted; the first byte is at position 1
- * @param length
- * - the number of consecutive bytes to be copied; the value for length must be 0 or greater
- * @return a byte array containing up to length consecutive bytes from the BLOB value designated by this Blob object, starting with the byte at
- * position pos
- * @throws SQLException
- * - if there is an error accessing the BLOB value; if pos is less than 1 or length is less than 0
- */
+ @Override
public byte[] getBytes(long pos,
int length) throws SQLException {
checkClosed();
@@ -223,34 +212,26 @@ public byte[] getBytes(long pos,
return bTemp;
}
- /**
- * Return the length of the BLOB
- *
- * @throws SQLException
- * when an error occurs
- * @return the data length
- */
+ @Override
public long length() throws SQLException {
checkClosed();
if (value == null && activeStreams.get(0) instanceof PLPInputStream) {
- return (long)((PLPInputStream)activeStreams.get(0)).payloadLength;
+ return (long) ((PLPInputStream) activeStreams.get(0)).payloadLength;
}
getBytesFromStream();
return value.length;
}
-
- /**
- * Function for the result set to maintain blobs it has created
- * @throws SQLException
- */
+
+ @Override
void fillFromStream() throws SQLException {
- if(!isClosed) {
- getBytesFromStream();
- }
+ if (!isClosed) {
+ getBytesFromStream();
+ }
}
-
+
/**
* Converts stream to byte[]
+ *
* @throws SQLServerException
*/
private void getBytesFromStream() throws SQLServerException {
@@ -266,21 +247,11 @@ private void getBytesFromStream() throws SQLServerException {
}
}
- /**
- * Retrieves the byte position in the BLOB value designated by this Blob object at which pattern begins. The search begins at position start.
- *
- * @param pattern
- * - the Blob object designating the BLOB value for which to search
- * @param start
- * - the position in the BLOB value at which to begin searching; the first position is 1
- * @return the postion at which the pattern begins, else -1
- * @throws SQLException
- * - if there is an error accessing the BLOB value or if start is less than 1
- */
- public long position(Blob pattern,
+ @Override
+ public long position(java.sql.Blob pattern,
long start) throws SQLException {
checkClosed();
-
+
getBytesFromStream();
if (start < 1) {
MessageFormat form = new MessageFormat(SQLServerException.getErrString("R_invalidPositionIndex"));
@@ -294,18 +265,7 @@ public long position(Blob pattern,
return position(pattern.getBytes((long) 1, (int) pattern.length()), start);
}
- /**
- * Retrieves the byte position at which the specified byte array pattern begins within the BLOB value that this Blob object represents. The search
- * for pattern begins at position start.
- *
- * @param bPattern
- * - the byte array for which to search
- * @param start
- * - the position at which to begin searching; the first position is 1
- * @return the position at which the pattern appears, else -1
- * @throws SQLException
- * - if there is an error accessing the BLOB or if start is less than 1
- */
+ @Override
public long position(byte[] bPattern,
long start) throws SQLException {
checkClosed();
@@ -316,7 +276,8 @@ public long position(byte[] bPattern,
SQLServerException.makeFromDriverError(con, null, form.format(msgArgs), null, true);
}
- // Back compat: Handle null search string as not found rather than throw an exception.
+ // Back compat: Handle null search string as not found rather than throw
+ // an exception.
// JDBC spec doesn't describe the behavior for a null pattern.
if (null == bPattern)
return -1;
@@ -342,20 +303,11 @@ public long position(byte[] bPattern,
return -1;
}
- /* JDBC 3.0 methods */
-
- /**
- * Truncate a BLOB
- *
- * @param len
- * the new length for the BLOB
- * @throws SQLException
- * when an error occurs
- */
+ @Override
public void truncate(long len) throws SQLException {
checkClosed();
getBytesFromStream();
-
+
if (len < 0) {
MessageFormat form = new MessageFormat(SQLServerException.getErrString("R_invalidLength"));
Object[] msgArgs = {len};
@@ -369,15 +321,7 @@ public void truncate(long len) throws SQLException {
}
}
- /**
- * Retrieves a stream that can be used to write to the BLOB value that this Blob object represents
- *
- * @param pos
- * - the position in the BLOB value at which to start writing; the first position is 1
- * @return a java.io.OutputStream object to which data can be written
- * @throws SQLException
- * - if there is an error accessing the BLOB value or if pos is less than 1
- */
+ @Override
public java.io.OutputStream setBinaryStream(long pos) throws SQLException {
checkClosed();
@@ -389,21 +333,11 @@ public java.io.OutputStream setBinaryStream(long pos) throws SQLException {
return new SQLServerBlobOutputStream(this, pos);
}
- /**
- * Writes the given array of bytes into the Blob starting at position pos, and returns the number of bytes written.
- *
- * @param pos
- * the position (1 based) in the Blob object at which to start writing the data.
- * @param bytes
- * the array of bytes to be written into the Blob.
- * @throws SQLException
- * if there is an error accessing the BLOB value.
- * @return the number of bytes written.
- */
+ @Override
public int setBytes(long pos,
byte[] bytes) throws SQLException {
checkClosed();
-
+
getBytesFromStream();
if (null == bytes)
SQLServerException.makeFromDriverError(con, null, SQLServerException.getErrString("R_cantSetNull"), null, true);
@@ -411,26 +345,7 @@ public int setBytes(long pos,
return setBytes(pos, bytes, 0, bytes.length);
}
- /**
- * Writes all or part of the given byte array to the BLOB value that this Blob object represents and returns the number of bytes written. Writing
- * starts at position pos in the BLOB value; len bytes from the given byte wrray are written. The array of bytes will overwrite the existing bytes
- * in the Blob object starting at the position pos. If the end of the Blob value is reached while writing the array bytes, then the length of the
- * Blob value will be increased to accomodate the extra bytes.
- *
- * SQL Server behavior: If the value specified for pos is greater than the length+1 of the BLOB value then a SQLException is thrown.
- *
- * @param pos
- * - the position in the BLOB object at which to start writing; the first position is 1
- * @param bytes
- * - the array of bytes to be written to this BLOB object.
- * @param offset
- * - the offset (0-based) into the array bytes at which to start reading the bytes to set
- * @param len
- * - the number of bytes to be written to the BLOB value from the array of bytes bytes
- * @return the number of bytes written.
- * @throws SQLException
- * - if there is an error accessing the BLOB value or if pos is less than 1
- */
+ @Override
public int setBytes(long pos,
byte[] bytes,
int offset,
@@ -469,7 +384,8 @@ public int setBytes(long pos,
// Overwrite past end of value case.
if (len >= value.length - pos) {
- // Make sure the new value length wouldn't exceed the maximum allowed
+ // Make sure the new value length wouldn't exceed the maximum
+ // allowed
DataTypes.getCheckedLength(con, JDBCType.BLOB, pos + len, false);
assert pos + len <= Integer.MAX_VALUE;
@@ -506,14 +422,14 @@ final class SQLServerBlobOutputStream extends java.io.OutputStream {
this.currentPos = startPos;
}
- // java.io.OutputStream interface methods.
-
+ @Override
public void write(byte[] b) throws IOException {
if (null == b)
return;
write(b, 0, b.length);
}
+ @Override
public void write(byte[] b,
int off,
int len) throws IOException {
@@ -529,6 +445,7 @@ public void write(byte[] b,
}
}
+ @Override
public void write(int b) throws java.io.IOException {
byte[] bTemp = new byte[1];
bTemp[0] = (byte) (b & 0xFF);
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkBatchInsertRecord.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkBatchInsertRecord.java
new file mode 100644
index 000000000..8ded138ac
--- /dev/null
+++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkBatchInsertRecord.java
@@ -0,0 +1,482 @@
+/*
+ * Microsoft JDBC Driver for SQL Server
+ *
+ * Copyright(c) Microsoft Corporation All rights reserved.
+ *
+ * This program is made available under the terms of the MIT License. See the LICENSE file in the project root for more information.
+ */
+
+package com.microsoft.sqlserver.jdbc;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.sql.Types;
+import java.text.DecimalFormat;
+import java.text.MessageFormat;
+import java.time.OffsetDateTime;
+import java.time.OffsetTime;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map.Entry;
+
+import java.util.Set;
+
+/**
+ * A simple implementation of the ISQLServerBulkRecord interface that can be
+ * used to read in the basic Java data types from an ArrayList of Parameters
+ * that were provided by pstmt/cstmt.
+ */
+public class SQLServerBulkBatchInsertRecord extends SQLServerBulkCommon {
+
+ private List
- * Note: All the data in the returned stream must be read prior to getting the value of any other column. The next call to a getter method
- * implicitly closes the stream. Also, a stream may return
- * Note: All the data in the returned stream must be read prior to getting the value of any other column. The next call to a getter method
- * implicitly closes the stream. Also, a stream may return
- * Note: All the data in the returned stream must be read prior to getting the value of any other column. The next call to a getter method
- * implicitly closes the stream. Also, a stream may return
- * Note: All the data in the returned stream must be read prior to getting the value of any other column. The next call to a getter method
- * implicitly closes the stream. Also, a stream may return
- * 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
- * Note that this method may be used to pass datatabase- specific abstract data types.
- *
- * @param sCol
- * the name of the parameter
- * @param o
- * the object containing the input parameter value
- * @param n
- * the SQL type (as defined in java.sql.Types) to be sent to the database. The scale argument may further qualify this type.
- * @param m
- * for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types, this is the number of digits after the decimal point. For all other
- * types, this value will be ignored.
- * @param forceEncrypt
- * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
- * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
- * encryption on parameters.
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- *
- * 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
- * Note that this method may be used to pass datatabase- specific abstract data types.
- *
- * @param sCol
- * the name of the parameter
- * @param x
- * the object containing the input parameter value
- * @param targetSqlType
- * the SQL type (as defined in java.sql.Types) to be sent to the database. The scale argument may further qualify this type.
- * @param precision
- * the precision of the column.
- * @param scale
- * the scale of the column.
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- *
- * This method is the same as the
- * Note: This method is optimized for handling parametric SQL statements that benefit from precompilation. If the driver supports
- * precompilation, the method
- * Result sets created using the returned
- * An SQL statement with or without IN parameters can be pre-compiled and stored in a
- * Note: This method is optimized for handling parametric SQL statements that benefit from precompilation. If the driver supports
- * precompilation, the method
- * Result sets created using the returned
- * An SQL statement with or without IN parameters can be pre-compiled and stored in a
- * Note: This method is optimized for handling parametric SQL statements that benefit from precompilation. If the driver supports
- * precompilation, the method
- * Result sets created using the returned
- * This class's public functions need to be kept identical to the SQLServerConnection's.
- * cancelQueryTimeout property set on this SQLServerStatement object.
+ *
+ * @return cancelQueryTimeout Time duration in seconds.
+ * @throws SQLServerException
+ * if any error occurs
+ */
+ public int getCancelQueryTimeout() throws SQLServerException;
+
+ /**
+ * Sets the cancelQueryTimeout property on this SQLServerStatement object to cancel queryTimeout set on Connection or
+ * Statement level.
+ *
+ * @param seconds
+ * Time duration in seconds.
+ * @throws SQLServerException
+ * if any error occurs
+ */
+ public void setCancelQueryTimeout(int seconds) throws SQLServerException;
+}
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/InternalSpatialDatatype.java b/src/main/java/com/microsoft/sqlserver/jdbc/InternalSpatialDatatype.java
index a4fc6edfb..003e30f5d 100644
--- a/src/main/java/com/microsoft/sqlserver/jdbc/InternalSpatialDatatype.java
+++ b/src/main/java/com/microsoft/sqlserver/jdbc/InternalSpatialDatatype.java
@@ -1,3 +1,11 @@
+/*
+ * Microsoft JDBC Driver for SQL Server
+ *
+ * Copyright(c) Microsoft Corporation All rights reserved.
+ *
+ * This program is made available under the terms of the MIT License. See the LICENSE file in the project root for more information.
+ */
+
package com.microsoft.sqlserver.jdbc;
public enum InternalSpatialDatatype {
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/KerbCallback.java b/src/main/java/com/microsoft/sqlserver/jdbc/KerbCallback.java
index 6f861c4bb..f2e312008 100644
--- a/src/main/java/com/microsoft/sqlserver/jdbc/KerbCallback.java
+++ b/src/main/java/com/microsoft/sqlserver/jdbc/KerbCallback.java
@@ -1,3 +1,11 @@
+/*
+ * Microsoft JDBC Driver for SQL Server
+ *
+ * Copyright(c) Microsoft Corporation All rights reserved.
+ *
+ * This program is made available under the terms of the MIT License. See the LICENSE file in the project root for more information.
+ */
+
package com.microsoft.sqlserver.jdbc;
import java.io.IOException;
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/Parameter.java b/src/main/java/com/microsoft/sqlserver/jdbc/Parameter.java
index b614ad5fe..2a9c757d0 100644
--- a/src/main/java/com/microsoft/sqlserver/jdbc/Parameter.java
+++ b/src/main/java/com/microsoft/sqlserver/jdbc/Parameter.java
@@ -415,6 +415,10 @@ Object getValue(JDBCType jdbcType,
// statement level), cryptoMeta would be null.
return getterDTV.getValue(jdbcType, outScale, getterArgs, cal, typeInfo, cryptoMeta, tdsReader);
}
+
+ Object getSetterValue() {
+ return setterDTV.getSetterValue();
+ }
int getInt(TDSReader tdsReader) throws SQLServerException {
Integer value = (Integer) getValue(JDBCType.INTEGER, null, null, tdsReader);
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLCollation.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLCollation.java
index d89a95e11..6dcf58cf6 100644
--- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLCollation.java
+++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLCollation.java
@@ -35,10 +35,16 @@
*/
final class SQLCollation implements java.io.Serializable
{
- private final int info; // First 4 bytes of TDS collation.
+ /**
+ *
+ */
+ private static final long serialVersionUID = 6748833280721312349L;
+
+ private final int info; // First 4 bytes of TDS collation.
private int langID() { return info & 0x0000FFFF; }
private final int sortId; // 5th byte of TDS collation.
private final Encoding encoding;
+ private static final int UTF8_IN_TDSCOLLATION = 0x4000000;
// Utility methods for getting details of this collation's encoding
final Charset getCharset() throws SQLServerException { return encoding.charset(); }
@@ -77,8 +83,13 @@ int getCollationSortID() {
*/
info = tdsReader.readInt(); // 4 bytes, contains: LCID ColFlags Version
sortId = tdsReader.readUnsignedByte(); // 1 byte, contains: SortId
- // For a SortId==0 collation, the LCID bits correspond to a LocaleId
- encoding = (0 == sortId) ? encodingFromLCID() : encodingFromSortId();
+ if (UTF8_IN_TDSCOLLATION == (info & UTF8_IN_TDSCOLLATION)) {
+ encoding = Encoding.UTF8;
+ }
+ else {
+ // For a SortId==0 collation, the LCID bits correspond to a LocaleId
+ encoding = (0 == sortId) ? encodingFromLCID() : encodingFromSortId();
+ }
}
/**
@@ -549,6 +560,7 @@ private Encoding encodingFromSortId() throws UnsupportedEncodingException {
enum Encoding
{
UNICODE ("UTF-16LE", true, false),
+ UTF8 ("UTF-8", true, false),
CP437 ("Cp437", false, false),
CP850 ("Cp850", false, false),
CP874 ("MS874", true, true),
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLJdbcVersion.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLJdbcVersion.java
index 964bb7ec9..41028eb8e 100644
--- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLJdbcVersion.java
+++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLJdbcVersion.java
@@ -11,6 +11,6 @@
final class SQLJdbcVersion {
static final int major = 6;
static final int minor = 5;
- static final int patch = 3;
+ static final int patch = 4;
static final int build = 0;
}
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerADAL4JUtils.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerADAL4JUtils.java
index 096543ffd..a04b98296 100644
--- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerADAL4JUtils.java
+++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerADAL4JUtils.java
@@ -1,3 +1,11 @@
+/*
+ * Microsoft JDBC Driver for SQL Server
+ *
+ * Copyright(c) Microsoft Corporation All rights reserved.
+ *
+ * This program is made available under the terms of the MIT License. See the LICENSE file in the project root for more information.
+ */
+
package com.microsoft.sqlserver.jdbc;
import java.io.IOException;
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBlob.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBlob.java
index f0d18eabb..3631e2374 100644
--- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBlob.java
+++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBlob.java
@@ -12,9 +12,7 @@
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
-import java.sql.Blob;
import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.concurrent.atomic.AtomicInteger;
@@ -26,6 +24,9 @@
*/
public final class SQLServerBlob extends SQLServerLob implements java.sql.Blob, java.io.Serializable {
+ /**
+ * Always refresh SerialVersionUID when prompted
+ */
private static final long serialVersionUID = -3526170228097889085L;
// The value of the BLOB that this Blob object represents.
@@ -38,15 +39,17 @@ public final class SQLServerBlob extends SQLServerLob implements java.sql.Blob,
// Active streams which must be closed when the Blob is closed
//
// Initial size of the array is based on an assumption that a Blob object is
- // typically used either for input or output, and then only once. The array size
+ // typically used either for input or output, and then only once. The array
+ // size
// grows automatically if multiple streams are used.
ArrayList
*
@@ -55,8 +60,13 @@
* The SQLServerBulkCopy class can be used to write data only to SQL Server tables. However, the data source is not limited to SQL Server; any data
* source can be used, as long as the data can be read with a ResultSet or ISQLServerBulkRecord instance.
*/
-public class SQLServerBulkCopy implements java.lang.AutoCloseable {
- /*
+public class SQLServerBulkCopy implements java.lang.AutoCloseable, java.io.Serializable {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1989903904654306244L;
+
+ /*
* Class to represent the column mappings between the source and destination table
*/
private class ColumnMapping {
@@ -153,6 +163,11 @@ private class ColumnMapping {
/* The CekTable for the destination table. */
private CekTable destCekTable = null;
+ /* Statement level encryption setting needed for querying against encrypted columns. */
+ private SQLServerStatementColumnEncryptionSetting stmtColumnEncriptionSetting = SQLServerStatementColumnEncryptionSetting.UseConnectionSetting;
+
+ private ResultSet destinationTableMetadata;
+
/*
* Metadata for the destination table columns
*/
@@ -1490,7 +1505,12 @@ private String createInsertBulkCommand(TDSWriter tdsWriter) throws SQLServerExce
if (null != destType && (destType.toLowerCase(Locale.ENGLISH).trim().startsWith("char") || destType.toLowerCase(Locale.ENGLISH).trim().startsWith("varchar")))
addCollate = " COLLATE " + columnCollation;
}
- bulkCmd.append("[" + colMapping.destinationColumnName + "] " + destType + addCollate + endColumn);
+ if (colMapping.destinationColumnName.contains("]")) {
+ String escapedColumnName = colMapping.destinationColumnName.replaceAll("]", "]]");
+ bulkCmd.append("[" + escapedColumnName + "] " + destType + addCollate + endColumn);
+ } else {
+ bulkCmd.append("[" + colMapping.destinationColumnName + "] " + destType + addCollate + endColumn);
+ }
}
if (true == copyOptions.isCheckConstraints()) {
@@ -1740,11 +1760,19 @@ private void getDestinationMetadata() throws SQLServerException {
SQLServerResultSet rs = null;
SQLServerResultSet rsMoreMetaData = null;
-
+ SQLServerStatement stmt = null;
+
try {
- // Get destination metadata
- rs = ((SQLServerStatement) connection.createStatement())
- .executeQueryInternal("SET FMTONLY ON SELECT * FROM " + destinationTableName + " SET FMTONLY OFF ");
+ if (null != destinationTableMetadata) {
+ rs = (SQLServerResultSet) destinationTableMetadata;
+ }
+ else {
+ stmt = (SQLServerStatement) connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY,
+ connection.getHoldability(), stmtColumnEncriptionSetting);
+
+ // Get destination metadata
+ rs = stmt.executeQueryInternal("sp_executesql N'SET FMTONLY ON SELECT * FROM " + destinationTableName + " '");
+ }
destColumnCount = rs.getMetaData().getColumnCount();
destColumnMetadata = new HashMap<>();
@@ -1783,6 +1811,8 @@ private void getDestinationMetadata() throws SQLServerException {
finally {
if (null != rs)
rs.close();
+ if (null != stmt)
+ stmt.close();
if (null != rsMoreMetaData)
rsMoreMetaData.close();
}
@@ -3059,12 +3089,63 @@ protected Object getTemporalObjectFromCSVWithFormatter(String valueStrUntrimmed,
int srcJdbcType,
int srcColOrdinal,
DateTimeFormatter dateTimeFormatter) throws SQLServerException {
- DriverJDBCVersion.checkSupportsJDBC42();
-
- SQLServerBulkCopy42Helper.getTemporalObjectFromCSVWithFormatter(valueStrUntrimmed, srcJdbcType, srcColOrdinal, dateTimeFormatter, connection,
- this);
-
- return null;
+ try {
+ TemporalAccessor ta = dateTimeFormatter.parse(valueStrUntrimmed);
+
+ int taHour, taMin, taSec, taYear, taMonth, taDay, taNano, taOffsetSec;
+ taHour = taMin = taSec = taYear = taMonth = taDay = taNano = taOffsetSec = 0;
+ if (ta.isSupported(ChronoField.NANO_OF_SECOND))
+ taNano = ta.get(ChronoField.NANO_OF_SECOND);
+ if (ta.isSupported(ChronoField.OFFSET_SECONDS))
+ taOffsetSec = ta.get(ChronoField.OFFSET_SECONDS);
+ if (ta.isSupported(ChronoField.HOUR_OF_DAY))
+ taHour = ta.get(ChronoField.HOUR_OF_DAY);
+ if (ta.isSupported(ChronoField.MINUTE_OF_HOUR))
+ taMin = ta.get(ChronoField.MINUTE_OF_HOUR);
+ if (ta.isSupported(ChronoField.SECOND_OF_MINUTE))
+ taSec = ta.get(ChronoField.SECOND_OF_MINUTE);
+ if (ta.isSupported(ChronoField.DAY_OF_MONTH))
+ taDay = ta.get(ChronoField.DAY_OF_MONTH);
+ if (ta.isSupported(ChronoField.MONTH_OF_YEAR))
+ taMonth = ta.get(ChronoField.MONTH_OF_YEAR);
+ if (ta.isSupported(ChronoField.YEAR))
+ taYear = ta.get(ChronoField.YEAR);
+
+ Calendar cal = new GregorianCalendar(new SimpleTimeZone(taOffsetSec * 1000, ""));
+ cal.clear();
+ cal.set(Calendar.HOUR_OF_DAY, taHour);
+ cal.set(Calendar.MINUTE, taMin);
+ cal.set(Calendar.SECOND, taSec);
+ cal.set(Calendar.DATE, taDay);
+ cal.set(Calendar.MONTH, taMonth - 1);
+ cal.set(Calendar.YEAR, taYear);
+ int fractionalSecondsLength = Integer.toString(taNano).length();
+ for (int i = 0; i < (9 - fractionalSecondsLength); i++)
+ taNano *= 10;
+ Timestamp ts = new Timestamp(cal.getTimeInMillis());
+ ts.setNanos(taNano);
+
+ switch (srcJdbcType) {
+ case java.sql.Types.TIMESTAMP:
+ return ts;
+ case java.sql.Types.TIME:
+ // Time is returned as Timestamp to preserve nano seconds.
+ cal.set(connection.baseYear(), Calendar.JANUARY, 01);
+ ts = new java.sql.Timestamp(cal.getTimeInMillis());
+ ts.setNanos(taNano);
+ return new java.sql.Timestamp(ts.getTime());
+ case java.sql.Types.DATE:
+ return new java.sql.Date(ts.getTime());
+ case microsoft.sql.Types.DATETIMEOFFSET:
+ return DateTimeOffset.valueOf(ts, taOffsetSec / 60);
+ }
+ }
+ catch (DateTimeException | ArithmeticException e) {
+ MessageFormat form = new MessageFormat(SQLServerException.getErrString("R_ParsingError"));
+ Object[] msgArgs = {JDBCType.of(srcJdbcType)};
+ throw new SQLServerException(this, form.format(msgArgs), null, 0, false);
+ }
+ return valueStrUntrimmed;
}
private Object getTemporalObjectFromCSV(Object value,
@@ -3573,4 +3654,12 @@ private boolean writeBatchData(TDSWriter tdsWriter,
}
}
}
+
+ protected void setStmtColumnEncriptionSetting(SQLServerStatementColumnEncryptionSetting stmtColumnEncriptionSetting) {
+ this.stmtColumnEncriptionSetting = stmtColumnEncriptionSetting;
+ }
+
+ protected void setDestinationTableMetadata(SQLServerResultSet rs) {
+ destinationTableMetadata = rs;
+ }
}
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCopy42Helper.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCopy42Helper.java
deleted file mode 100644
index ea9ff510f..000000000
--- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCopy42Helper.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Microsoft JDBC Driver for SQL Server
- *
- * Copyright(c) Microsoft Corporation All rights reserved.
- *
- * This program is made available under the terms of the MIT License. See the LICENSE file in the project root for more information.
- */
-
-package com.microsoft.sqlserver.jdbc;
-
-import java.sql.Timestamp;
-import java.text.MessageFormat;
-import java.time.DateTimeException;
-import java.time.format.DateTimeFormatter;
-import java.time.temporal.ChronoField;
-import java.time.temporal.TemporalAccessor;
-import java.util.Calendar;
-import java.util.GregorianCalendar;
-import java.util.SimpleTimeZone;
-
-import microsoft.sql.DateTimeOffset;
-
-/**
- *
- * This class is separated from SQLServerBulkCopy class to resolve run-time error of missing Java 8 types when running with Java 7
- *
- */
-class SQLServerBulkCopy42Helper {
- static Object getTemporalObjectFromCSVWithFormatter(String valueStrUntrimmed,
- int srcJdbcType,
- int srcColOrdinal,
- DateTimeFormatter dateTimeFormatter,
- SQLServerConnection connection,
- SQLServerBulkCopy sqlServerBC) throws SQLServerException {
- DriverJDBCVersion.checkSupportsJDBC42();
-
- try {
- TemporalAccessor ta = dateTimeFormatter.parse(valueStrUntrimmed);
-
- int taHour, taMin, taSec, taYear, taMonth, taDay, taNano, taOffsetSec;
- taHour = taMin = taSec = taYear = taMonth = taDay = taNano = taOffsetSec = 0;
- if (ta.isSupported(ChronoField.NANO_OF_SECOND))
- taNano = ta.get(ChronoField.NANO_OF_SECOND);
- if (ta.isSupported(ChronoField.OFFSET_SECONDS))
- taOffsetSec = ta.get(ChronoField.OFFSET_SECONDS);
- if (ta.isSupported(ChronoField.HOUR_OF_DAY))
- taHour = ta.get(ChronoField.HOUR_OF_DAY);
- if (ta.isSupported(ChronoField.MINUTE_OF_HOUR))
- taMin = ta.get(ChronoField.MINUTE_OF_HOUR);
- if (ta.isSupported(ChronoField.SECOND_OF_MINUTE))
- taSec = ta.get(ChronoField.SECOND_OF_MINUTE);
- if (ta.isSupported(ChronoField.DAY_OF_MONTH))
- taDay = ta.get(ChronoField.DAY_OF_MONTH);
- if (ta.isSupported(ChronoField.MONTH_OF_YEAR))
- taMonth = ta.get(ChronoField.MONTH_OF_YEAR);
- if (ta.isSupported(ChronoField.YEAR))
- taYear = ta.get(ChronoField.YEAR);
-
- Calendar cal = new GregorianCalendar(new SimpleTimeZone(taOffsetSec * 1000, ""));
- cal.clear();
- cal.set(Calendar.HOUR_OF_DAY, taHour);
- cal.set(Calendar.MINUTE, taMin);
- cal.set(Calendar.SECOND, taSec);
- cal.set(Calendar.DATE, taDay);
- cal.set(Calendar.MONTH, taMonth - 1);
- cal.set(Calendar.YEAR, taYear);
- int fractionalSecondsLength = Integer.toString(taNano).length();
- for (int i = 0; i < (9 - fractionalSecondsLength); i++)
- taNano *= 10;
- Timestamp ts = new Timestamp(cal.getTimeInMillis());
- ts.setNanos(taNano);
-
- switch (srcJdbcType) {
- case java.sql.Types.TIMESTAMP:
- return ts;
- case java.sql.Types.TIME:
- // Time is returned as Timestamp to preserve nano seconds.
- cal.set(connection.baseYear(), Calendar.JANUARY, 01);
- ts = new java.sql.Timestamp(cal.getTimeInMillis());
- ts.setNanos(taNano);
- return new java.sql.Timestamp(ts.getTime());
- case java.sql.Types.DATE:
- return new java.sql.Date(ts.getTime());
- case microsoft.sql.Types.DATETIMEOFFSET:
- return DateTimeOffset.valueOf(ts, taOffsetSec / 60);
- }
- }
- catch (DateTimeException | ArithmeticException e) {
- MessageFormat form = new MessageFormat(SQLServerException.getErrString("R_ParsingError"));
- Object[] msgArgs = {JDBCType.of(srcJdbcType)};
- throw new SQLServerException(sqlServerBC, form.format(msgArgs), null, 0, false);
- }
- // unreachable code. Need to do to compile from Eclipse.
- return valueStrUntrimmed;
- }
-}
\ No newline at end of file
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement.java
index c30eab2fa..57da43fff 100644
--- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement.java
+++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement.java
@@ -22,11 +22,10 @@
import java.sql.ResultSet;
import java.sql.RowId;
import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
+import java.sql.SQLType;
import java.sql.SQLXML;
import java.sql.Time;
import java.sql.Timestamp;
-import java.sql.Types;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Calendar;
@@ -43,7 +42,7 @@
public class SQLServerCallableStatement extends SQLServerPreparedStatement implements ISQLServerCallableStatement {
/** the call param names */
- private ArrayListResultSet object as a stream of ASCII characters. The
- * value can then be read in chunks from the stream. This method is particularly suitable for retrieving large LONGVARCHAR values.
- * The JDBC driver will do any necessary conversion from the database format into ASCII.
- *
- * 0 when the method InputStream.available is called whether
- * there is data available or not.
- *
- * @param paramIndex
- * the first column is 1, the second is 2, ...
- * @return a Java input stream that delivers the database column value as a stream of one-byte ASCII characters; if the value is SQL
- * NULL, the value returned is null
- * @throws SQLServerException
- * if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set
- */
- public final java.io.InputStream getAsciiStream(int paramIndex) throws SQLServerException {
- loggerExternal.entering(getClassNameLogging(), "getAsciiStream", paramIndex);
+ @Override
+ public final java.io.InputStream getAsciiStream(int parameterIndex) throws SQLServerException {
+ loggerExternal.entering(getClassNameLogging(), "getAsciiStream", parameterIndex);
checkClosed();
- InputStream value = (InputStream) getStream(paramIndex, StreamType.ASCII);
+ InputStream value = (InputStream) getStream(parameterIndex, StreamType.ASCII);
loggerExternal.exiting(getClassNameLogging(), "getAsciiStream", value);
return value;
}
- /**
- * Retrieves the value of the designated column in the current row of this ResultSet object as a stream of ASCII characters. The
- * value can then be read in chunks from the stream. This method is particularly suitable for retrieving large LONGVARCHAR values.
- * The JDBC driver will do any necessary conversion from the database format into ASCII.
- *
- * 0 when the method available is called whether there is data
- * available or not.
- *
- * @param paramName
- * the name of the parameter
- * @return a Java input stream that delivers the database column value as a stream of one-byte ASCII characters. If the value is SQL
- * NULL, the value returned is null.
- * @throws SQLServerException
- * if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set
- */
- public final java.io.InputStream getAsciiStream(String paramName) throws SQLServerException {
- loggerExternal.entering(getClassNameLogging(), "getAsciiStream", paramName);
+ @Override
+ public final java.io.InputStream getAsciiStream(String parameterName) throws SQLServerException {
+ loggerExternal.entering(getClassNameLogging(), "getAsciiStream", parameterName);
checkClosed();
- InputStream value = (InputStream) getStream(findColumn(paramName), StreamType.ASCII);
+ InputStream value = (InputStream) getStream(findColumn(parameterName), StreamType.ASCII);
loggerExternal.exiting(getClassNameLogging(), "getAsciiStream", value);
return value;
}
- public BigDecimal getBigDecimal(int index) throws SQLServerException {
- loggerExternal.entering(getClassNameLogging(), "getBigDecimal", index);
+ @Override
+ public BigDecimal getBigDecimal(int parameterIndex) throws SQLServerException {
+ loggerExternal.entering(getClassNameLogging(), "getBigDecimal", parameterIndex);
checkClosed();
- BigDecimal value = (BigDecimal) getValue(index, JDBCType.DECIMAL);
+ BigDecimal value = (BigDecimal) getValue(parameterIndex, JDBCType.DECIMAL);
loggerExternal.exiting(getClassNameLogging(), "getBigDecimal", value);
return value;
}
- public BigDecimal getBigDecimal(String sCol) throws SQLServerException {
- loggerExternal.entering(getClassNameLogging(), "getBigDecimal", sCol);
+ @Override
+ public BigDecimal getBigDecimal(String parameterName) throws SQLServerException {
+ loggerExternal.entering(getClassNameLogging(), "getBigDecimal", parameterName);
checkClosed();
- BigDecimal value = (BigDecimal) getValue(findColumn(sCol), JDBCType.DECIMAL);
+ BigDecimal value = (BigDecimal) getValue(findColumn(parameterName), JDBCType.DECIMAL);
loggerExternal.exiting(getClassNameLogging(), "getBigDecimal", value);
return value;
}
- /**
- * Retrieves the value of the column specified as a java.math.BigDecimal object.
- *
- * @param index
- * The zero-based ordinal of a column.
- * @return the column value; if the value is SQL NULL, the value returned is null
- * @throws SQLServerException
- * when an error occurs
- */
- public BigDecimal getMoney(int index) throws SQLServerException {
- loggerExternal.entering(getClassNameLogging(), "getMoney", index);
+ @Override
+ public BigDecimal getMoney(int parameterIndex) throws SQLServerException {
+ loggerExternal.entering(getClassNameLogging(), "getMoney", parameterIndex);
checkClosed();
- BigDecimal value = (BigDecimal) getValue(index, JDBCType.MONEY);
+ BigDecimal value = (BigDecimal) getValue(parameterIndex, JDBCType.MONEY);
loggerExternal.exiting(getClassNameLogging(), "getMoney", value);
return value;
}
- /**
- * Retrieves the value of the column specified as a java.math.BigDecimal object.
- *
- * @param sCol
- * The name of a column.
- * @return the column value; if the value is SQL NULL, the value returned is null.
- * @throws SQLServerException
- * when an error occurs
- */
- public BigDecimal getMoney(String sCol) throws SQLServerException {
- loggerExternal.entering(getClassNameLogging(), "getMoney", sCol);
+ @Override
+ public BigDecimal getMoney(String parameterName) throws SQLServerException {
+ loggerExternal.entering(getClassNameLogging(), "getMoney", parameterName);
checkClosed();
- BigDecimal value = (BigDecimal) getValue(findColumn(sCol), JDBCType.MONEY);
+ BigDecimal value = (BigDecimal) getValue(findColumn(parameterName), JDBCType.MONEY);
loggerExternal.exiting(getClassNameLogging(), "getMoney", value);
return value;
}
- /**
- * Retrieves the value of the column specified as a java.math.BigDecimal object.
- *
- * @param index
- * The zero-based ordinal of a column.
- * @return the column value; if the value is SQL NULL, the value returned is null
- * @throws SQLServerException
- * when an error occurs
- */
- public BigDecimal getSmallMoney(int index) throws SQLServerException {
- loggerExternal.entering(getClassNameLogging(), "getSmallMoney", index);
+ @Override
+ public BigDecimal getSmallMoney(int parameterIndex) throws SQLServerException {
+ loggerExternal.entering(getClassNameLogging(), "getSmallMoney", parameterIndex);
checkClosed();
- BigDecimal value = (BigDecimal) getValue(index, JDBCType.SMALLMONEY);
+ BigDecimal value = (BigDecimal) getValue(parameterIndex, JDBCType.SMALLMONEY);
loggerExternal.exiting(getClassNameLogging(), "getSmallMoney", value);
return value;
}
- /**
- * Retrieves the value of the column specified as a java.math.BigDecimal object.
- *
- * @param sCol
- * The name of a column.
- * @return the column value; if the value is SQL NULL, the value returned is null.
- * @throws SQLServerException
- * when an error occurs
- */
- public BigDecimal getSmallMoney(String sCol) throws SQLServerException {
- loggerExternal.entering(getClassNameLogging(), "getSmallMoney", sCol);
+ @Override
+ public BigDecimal getSmallMoney(String parameterName) throws SQLServerException {
+ loggerExternal.entering(getClassNameLogging(), "getSmallMoney", parameterName);
checkClosed();
- BigDecimal value = (BigDecimal) getValue(findColumn(sCol), JDBCType.SMALLMONEY);
+ BigDecimal value = (BigDecimal) getValue(findColumn(parameterName), JDBCType.SMALLMONEY);
loggerExternal.exiting(getClassNameLogging(), "getSmallMoney", value);
return value;
}
- /**
- * Retrieves the value of the designated column in the current row of this ResultSet object as a stream of uninterpreted bytes. The
- * value can then be read in chunks from the stream. This method is particularly suitable for retrieving large LONGVARBINARY values.
- *
- * 0 when the method InputStream.available is called whether
- * there is data available or not.
- *
- * @param paramIndex
- * the first column is 1, the second is 2, ...
- * @return a Java input stream that delivers the database column value as a stream of uninterpreted bytes; if the value is SQL NULL,
- * the value returned is null
- * @throws SQLServerException
- * if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set
- */
- public final java.io.InputStream getBinaryStream(int paramIndex) throws SQLServerException {
- loggerExternal.entering(getClassNameLogging(), "getBinaryStream", paramIndex);
+ @Override
+ public final java.io.InputStream getBinaryStream(int parameterIndex) throws SQLServerException {
+ loggerExternal.entering(getClassNameLogging(), "getBinaryStream", parameterIndex);
checkClosed();
- InputStream value = (InputStream) getStream(paramIndex, StreamType.BINARY);
+ InputStream value = (InputStream) getStream(parameterIndex, StreamType.BINARY);
loggerExternal.exiting(getClassNameLogging(), "getBinaryStream", value);
return value;
}
- /**
- * Retrieves the value of the designated column in the current row of this ResultSet object as a stream of uninterpreted
- * bytes. The value can then be read in chunks from the stream. This method is particularly suitable for retrieving large
- * LONGVARBINARY values.
- *
- * 0 when the method available is called whether there is data
- * available or not.
- *
- * @param paramName
- * the name of the parameter
- * @return a Java input stream that delivers the database column value as a stream of uninterpreted bytes; if the value is SQL NULL,
- * the result is null
- * @throws SQLServerException
- * if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set
- */
- public final java.io.InputStream getBinaryStream(String paramName) throws SQLServerException {
- loggerExternal.entering(getClassNameLogging(), "getBinaryStream", paramName);
+ @Override
+ public final java.io.InputStream getBinaryStream(String parameterName) throws SQLServerException {
+ loggerExternal.entering(getClassNameLogging(), "getBinaryStream", parameterName);
checkClosed();
- InputStream value = (InputStream) getStream(findColumn(paramName), StreamType.BINARY);
+ InputStream value = (InputStream) getStream(findColumn(parameterName), StreamType.BINARY);
loggerExternal.exiting(getClassNameLogging(), "getBinaryStream", value);
return value;
}
- public Blob getBlob(int index) throws SQLServerException {
- loggerExternal.entering(getClassNameLogging(), "getBlob", index);
+ @Override
+ public Blob getBlob(int parameterIndex) throws SQLServerException {
+ loggerExternal.entering(getClassNameLogging(), "getBlob", parameterIndex);
checkClosed();
- Blob value = (Blob) getValue(index, JDBCType.BLOB);
+ Blob value = (Blob) getValue(parameterIndex, JDBCType.BLOB);
loggerExternal.exiting(getClassNameLogging(), "getBlob", value);
return value;
}
- public Blob getBlob(String sCol) throws SQLServerException {
- loggerExternal.entering(getClassNameLogging(), "getBlob", sCol);
+ @Override
+ public Blob getBlob(String parameterName) throws SQLServerException {
+ loggerExternal.entering(getClassNameLogging(), "getBlob", parameterName);
checkClosed();
- Blob value = (Blob) getValue(findColumn(sCol), JDBCType.BLOB);
+ Blob value = (Blob) getValue(findColumn(parameterName), JDBCType.BLOB);
loggerExternal.exiting(getClassNameLogging(), "getBlob", value);
return value;
}
- public final java.io.Reader getCharacterStream(int paramIndex) throws SQLServerException {
- loggerExternal.entering(getClassNameLogging(), "getCharacterStream", paramIndex);
+ @Override
+ public final java.io.Reader getCharacterStream(int parameterIndex) throws SQLServerException {
+ loggerExternal.entering(getClassNameLogging(), "getCharacterStream", parameterIndex);
checkClosed();
- Reader reader = (Reader) getStream(paramIndex, StreamType.CHARACTER);
+ Reader reader = (Reader) getStream(parameterIndex, StreamType.CHARACTER);
loggerExternal.exiting(getClassNameLogging(), "getCharacterStream", reader);
return reader;
}
+ @Override
public final java.io.Reader getCharacterStream(String parameterName) throws SQLException {
loggerExternal.entering(getClassNameLogging(), "getCharacterStream", parameterName);
checkClosed();
@@ -1292,6 +1165,7 @@ public final java.io.Reader getCharacterStream(String parameterName) throws SQLE
return reader;
}
+ @Override
public final java.io.Reader getNCharacterStream(int parameterIndex) throws SQLException {
loggerExternal.entering(getClassNameLogging(), "getNCharacterStream", parameterIndex);
checkClosed();
@@ -1300,6 +1174,7 @@ public final java.io.Reader getNCharacterStream(int parameterIndex) throws SQLEx
return reader;
}
+ @Override
public final java.io.Reader getNCharacterStream(String parameterName) throws SQLException {
loggerExternal.entering(getClassNameLogging(), "getNCharacterStream", parameterName);
checkClosed();
@@ -1322,22 +1197,25 @@ void closeActiveStream() throws SQLServerException {
}
}
- public Clob getClob(int index) throws SQLServerException {
- loggerExternal.entering(getClassNameLogging(), "getClob", index);
+ @Override
+ public Clob getClob(int parameterIndex) throws SQLServerException {
+ loggerExternal.entering(getClassNameLogging(), "getClob", parameterIndex);
checkClosed();
- Clob clob = (Clob) getValue(index, JDBCType.CLOB);
+ Clob clob = (Clob) getValue(parameterIndex, JDBCType.CLOB);
loggerExternal.exiting(getClassNameLogging(), "getClob", clob);
return clob;
}
- public Clob getClob(String sCol) throws SQLServerException {
- loggerExternal.entering(getClassNameLogging(), "getClob", sCol);
+ @Override
+ public Clob getClob(String parameterName) throws SQLServerException {
+ loggerExternal.entering(getClassNameLogging(), "getClob", parameterName);
checkClosed();
- Clob clob = (Clob) getValue(findColumn(sCol), JDBCType.CLOB);
+ Clob clob = (Clob) getValue(findColumn(parameterName), JDBCType.CLOB);
loggerExternal.exiting(getClassNameLogging(), "getClob", clob);
return clob;
}
+ @Override
public NClob getNClob(int parameterIndex) throws SQLException {
loggerExternal.entering(getClassNameLogging(), "getNClob", parameterIndex);
checkClosed();
@@ -1346,6 +1224,7 @@ public NClob getNClob(int parameterIndex) throws SQLException {
return nClob;
}
+ @Override
public NClob getNClob(String parameterName) throws SQLException {
loggerExternal.entering(getClassNameLogging(), "getNClob", parameterName);
checkClosed();
@@ -1354,36 +1233,42 @@ public NClob getNClob(String parameterName) throws SQLException {
return nClob;
}
- /* L0 */ public Object getObject(int index,
- java.util.Mapjava.sql.Timestamp value. The driver converts this to an SQL TIMESTAMP
- * value when it sends it to the database.
- *
- * @param sCol
- * the name of the parameter
- * @param x
- * the parameter value
- * @param c
- * a java.util.Calendar
- * @param forceEncrypt
- * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
- * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
- * encryption on parameters.
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- * @see #getTimestamp
- */
- public void setTimestamp(String sCol,
- java.sql.Timestamp x,
- Calendar c,
+ @Override
+ public void setTimestamp(String parameterName,
+ java.sql.Timestamp value,
+ Calendar calendar,
boolean forceEncrypt) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setTimeStamp", new Object[] {sCol, x, c, forceEncrypt});
+ loggerExternal.entering(getClassNameLogging(), "setTimeStamp", new Object[] {parameterName, value, calendar, forceEncrypt});
checkClosed();
- setValue(findColumn(sCol), JDBCType.TIMESTAMP, x, JavaType.TIMESTAMP, c, forceEncrypt);
+ setValue(findColumn(parameterName), JDBCType.TIMESTAMP, value, JavaType.TIMESTAMP, calendar, forceEncrypt);
loggerExternal.exiting(getClassNameLogging(), "setTimeStamp");
}
- public void setTime(String sCol,
- java.sql.Time x,
- Calendar c) throws SQLServerException {
+ @Override
+ public void setTime(String parameterName,
+ java.sql.Time value,
+ Calendar calendar) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setTime", new Object[] {sCol, x, c});
+ loggerExternal.entering(getClassNameLogging(), "setTime", new Object[] {parameterName, value, calendar});
checkClosed();
- setValue(findColumn(sCol), JDBCType.TIME, x, JavaType.TIME, c, false);
+ setValue(findColumn(parameterName), JDBCType.TIME, value, JavaType.TIME, calendar, false);
loggerExternal.exiting(getClassNameLogging(), "setTime");
}
- /**
- * Sets the designated parameter to the given java.sql.Time value, using the given Calendar object. The driver uses the
- * Calendar object to construct an SQL TIME value, which the driver then sends to the database. With a a
- * Calendar object, the driver can calculate the time taking into account a custom timezone. If no Calendar object is
- * specified, the driver uses the default timezone, which is that of the virtual machine running the application.
- *
- * @param sCol
- * the name of the parameter
- * @param x
- * the parameter value
- * @param c
- * the Calendar object the driver will use to construct the time
- * @param forceEncrypt
- * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
- * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
- * encryption on parameters.
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- * @see #getTime
- */
- public void setTime(String sCol,
- java.sql.Time x,
- Calendar c,
+ @Override
+ public void setTime(String parameterName,
+ java.sql.Time value,
+ Calendar calendar,
boolean forceEncrypt) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setTime", new Object[] {sCol, x, c, forceEncrypt});
+ loggerExternal.entering(getClassNameLogging(), "setTime", new Object[] {parameterName, value, calendar, forceEncrypt});
checkClosed();
- setValue(findColumn(sCol), JDBCType.TIME, x, JavaType.TIME, c, forceEncrypt);
+ setValue(findColumn(parameterName), JDBCType.TIME, value, JavaType.TIME, calendar, forceEncrypt);
loggerExternal.exiting(getClassNameLogging(), "setTime");
}
- public void setDate(String sCol,
- java.sql.Date x,
- Calendar c) throws SQLServerException {
+ @Override
+ public void setDate(String parameterName,
+ java.sql.Date value,
+ Calendar calendar) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setDate", new Object[] {sCol, x, c});
+ loggerExternal.entering(getClassNameLogging(), "setDate", new Object[] {parameterName, value, calendar});
checkClosed();
- setValue(findColumn(sCol), JDBCType.DATE, x, JavaType.DATE, c, false);
+ setValue(findColumn(parameterName), JDBCType.DATE, value, JavaType.DATE, calendar, false);
loggerExternal.exiting(getClassNameLogging(), "setDate");
}
- /**
- * Sets the designated parameter to the given java.sql.Date value, using the given Calendar object. The driver uses the
- * Calendar object to construct an SQL DATE value, which the driver then sends to the database. With a a
- * Calendar object, the driver can calculate the date taking into account a custom timezone. If no Calendar object is
- * specified, the driver uses the default timezone, which is that of the virtual machine running the application.
- *
- * @param sCol
- * the name of the parameter
- * @param x
- * the parameter value
- * @param c
- * the Calendar object the driver will use to construct the date
- * @param forceEncrypt
- * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
- * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
- * encryption on parameters.
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- * @see #getDate
- */
- public void setDate(String sCol,
- java.sql.Date x,
- Calendar c,
+ @Override
+ public void setDate(String parameterName,
+ java.sql.Date value,
+ Calendar calendar,
boolean forceEncrypt) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setDate", new Object[] {sCol, x, c, forceEncrypt});
+ loggerExternal.entering(getClassNameLogging(), "setDate", new Object[] {parameterName, value, calendar, forceEncrypt});
checkClosed();
- setValue(findColumn(sCol), JDBCType.DATE, x, JavaType.DATE, c, forceEncrypt);
+ setValue(findColumn(parameterName), JDBCType.DATE, value, JavaType.DATE, calendar, forceEncrypt);
loggerExternal.exiting(getClassNameLogging(), "setDate");
}
+ @Override
public final void setCharacterStream(String parameterName,
Reader reader) throws SQLException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
@@ -1641,6 +1470,7 @@ public final void setCharacterStream(String parameterName,
loggerExternal.exiting(getClassNameLogging(), "setCharacterStream");
}
+ @Override
public final void setCharacterStream(String parameterName,
Reader value,
int length) throws SQLException {
@@ -1651,6 +1481,7 @@ public final void setCharacterStream(String parameterName,
loggerExternal.exiting(getClassNameLogging(), "setCharacterStream");
}
+ @Override
public final void setCharacterStream(String parameterName,
Reader reader,
long length) throws SQLException {
@@ -1662,6 +1493,7 @@ public final void setCharacterStream(String parameterName,
loggerExternal.exiting(getClassNameLogging(), "setCharacterStream");
}
+ @Override
public final void setNCharacterStream(String parameterName,
Reader value) throws SQLException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
@@ -1671,6 +1503,7 @@ public final void setNCharacterStream(String parameterName,
loggerExternal.exiting(getClassNameLogging(), "setNCharacterStream");
}
+ @Override
public final void setNCharacterStream(String parameterName,
Reader value,
long length) throws SQLException {
@@ -1681,15 +1514,17 @@ public final void setNCharacterStream(String parameterName,
loggerExternal.exiting(getClassNameLogging(), "setNCharacterStream");
}
+ @Override
public final void setClob(String parameterName,
- Clob x) throws SQLException {
+ Clob value) throws SQLException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setClob", new Object[] {parameterName, x});
+ loggerExternal.entering(getClassNameLogging(), "setClob", new Object[] {parameterName, value});
checkClosed();
- setValue(findColumn(parameterName), JDBCType.CLOB, x, JavaType.CLOB, false);
+ setValue(findColumn(parameterName), JDBCType.CLOB, value, JavaType.CLOB, false);
loggerExternal.exiting(getClassNameLogging(), "setClob");
}
+ @Override
public final void setClob(String parameterName,
Reader reader) throws SQLException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
@@ -1699,6 +1534,7 @@ public final void setClob(String parameterName,
loggerExternal.exiting(getClassNameLogging(), "setClob");
}
+ @Override
public final void setClob(String parameterName,
Reader value,
long length) throws SQLException {
@@ -1709,6 +1545,7 @@ public final void setClob(String parameterName,
loggerExternal.exiting(getClassNameLogging(), "setClob");
}
+ @Override
public final void setNClob(String parameterName,
NClob value) throws SQLException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
@@ -1718,6 +1555,7 @@ public final void setNClob(String parameterName,
loggerExternal.exiting(getClassNameLogging(), "setNClob");
}
+ @Override
public final void setNClob(String parameterName,
Reader reader) throws SQLException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
@@ -1727,6 +1565,7 @@ public final void setNClob(String parameterName,
loggerExternal.exiting(getClassNameLogging(), "setNClob");
}
+ @Override
public final void setNClob(String parameterName,
Reader reader,
long length) throws SQLException {
@@ -1737,6 +1576,7 @@ public final void setNClob(String parameterName,
loggerExternal.exiting(getClassNameLogging(), "setNClob");
}
+ @Override
public final void setNString(String parameterName,
String value) throws SQLException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
@@ -1746,26 +1586,10 @@ public final void setNString(String parameterName,
loggerExternal.exiting(getClassNameLogging(), "setNString");
}
- /**
- * Sets the designated parameter to the given String object. The driver converts this to a SQL NCHAR or
- * NVARCHAR or LONGNVARCHAR
- *
- * @param parameterName
- * the name of the parameter to be set
- * @param value
- * the parameter value
- * @param forceEncrypt
- * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
- * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
- * encryption on parameters.
- * @throws SQLException
- * if parameterName does not correspond to a named parameter; if the driver does not support national character sets; if the driver
- * can detect that a data conversion error could occur; if a database access error occurs or this method is called on a closed
- * CallableStatement
- */
+ @Override
public final void setNString(String parameterName,
String value,
- boolean forceEncrypt) throws SQLException {
+ boolean forceEncrypt) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
loggerExternal.entering(getClassNameLogging(), "setNString", new Object[] {parameterName, value, forceEncrypt});
checkClosed();
@@ -1773,131 +1597,77 @@ public final void setNString(String parameterName,
loggerExternal.exiting(getClassNameLogging(), "setNString");
}
- public void setObject(String sCol,
- Object o) throws SQLServerException {
+ @Override
+ public void setObject(String parameterName,
+ Object value) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setObject", new Object[] {sCol, o});
+ loggerExternal.entering(getClassNameLogging(), "setObject", new Object[] {parameterName, value});
checkClosed();
- setObjectNoType(findColumn(sCol), o, false);
+ setObjectNoType(findColumn(parameterName), value, false);
loggerExternal.exiting(getClassNameLogging(), "setObject");
}
- public void setObject(String sCol,
- Object o,
- int n) throws SQLServerException {
+ @Override
+ public void setObject(String parameterName,
+ Object value,
+ int sqlType) throws SQLServerException {
String tvpName = null;
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setObject", new Object[] {sCol, o, n});
+ loggerExternal.entering(getClassNameLogging(), "setObject", new Object[] {parameterName, value, sqlType});
checkClosed();
- if (microsoft.sql.Types.STRUCTURED == n) {
- tvpName = getTVPNameIfNull(findColumn(sCol), null);
- setObject(setterGetParam(findColumn(sCol)), o, JavaType.TVP, JDBCType.TVP, null, null, false, findColumn(sCol), tvpName);
+ if (microsoft.sql.Types.STRUCTURED == sqlType) {
+ tvpName = getTVPNameIfNull(findColumn(parameterName), null);
+ setObject(setterGetParam(findColumn(parameterName)), value, JavaType.TVP, JDBCType.TVP, null, null, false, findColumn(parameterName),
+ tvpName);
}
else
- setObject(setterGetParam(findColumn(sCol)), o, JavaType.of(o), JDBCType.of(n), null, null, false, findColumn(sCol), tvpName);
+ setObject(setterGetParam(findColumn(parameterName)), value, JavaType.of(value), JDBCType.of(sqlType), null, null, false,
+ findColumn(parameterName), tvpName);
loggerExternal.exiting(getClassNameLogging(), "setObject");
}
- public void setObject(String sCol,
- Object o,
- int n,
- int m) throws SQLServerException {
+ @Override
+ public void setObject(String parameterName,
+ Object value,
+ int sqlType,
+ int decimals) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setObject", new Object[] {sCol, o, n, m});
+ loggerExternal.entering(getClassNameLogging(), "setObject", new Object[] {parameterName, value, sqlType, decimals});
checkClosed();
-
- setObject(setterGetParam(findColumn(sCol)), o, JavaType.of(o), JDBCType.of(n), m, null, false, findColumn(sCol), null);
-
+ setObject(setterGetParam(findColumn(parameterName)), value, JavaType.of(value), JDBCType.of(sqlType), decimals, null, false,
+ findColumn(parameterName), null);
loggerExternal.exiting(getClassNameLogging(), "setObject");
}
- /**
- * Sets the value of the designated parameter with the given object.
- *
- * SQLData), the JDBC driver should call the method
- * SQLData.writeSQL to write it to the SQL data stream. If, on the other hand, the object is of a class implementing
- * Ref, Blob, Clob, NClob, Struct, java.net.URL, or
- * Array, the driver should pass it to the database as a value of the corresponding SQL type.
- * CallableStatement
- * @see Types
- * @see #getObject
- */
- public void setObject(String sCol,
- Object o,
- int n,
- int m,
+ @Override
+ public void setObject(String parameterName,
+ Object value,
+ int sqlType,
+ int decimals,
boolean forceEncrypt) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setObject", new Object[] {sCol, o, n, m, forceEncrypt});
+ loggerExternal.entering(getClassNameLogging(), "setObject", new Object[] {parameterName, value, sqlType, decimals, forceEncrypt});
checkClosed();
// scale - for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types,
// this is the number of digits after the decimal point.
// For all other types, this value will be ignored.
- setObject(setterGetParam(findColumn(sCol)), o, JavaType.of(o), JDBCType.of(n),
- (java.sql.Types.NUMERIC == n || java.sql.Types.DECIMAL == n) ? m : null, null, forceEncrypt, findColumn(sCol), null);
+ setObject(setterGetParam(findColumn(parameterName)), value, JavaType.of(value), JDBCType.of(sqlType),
+ (java.sql.Types.NUMERIC == sqlType || java.sql.Types.DECIMAL == sqlType) ? decimals : null, null, forceEncrypt,
+ findColumn(parameterName), null);
loggerExternal.exiting(getClassNameLogging(), "setObject");
}
- /**
- * Sets the value of the designated parameter with the given object.
- *
- * SQLData), the JDBC driver should call the method
- * SQLData.writeSQL to write it to the SQL data stream. If, on the other hand, the object is of a class implementing
- * Ref, Blob, Clob, NClob, Struct, java.net.URL, or
- * Array, the driver should pass it to the database as a value of the corresponding SQL type.
- * CallableStatement
- * @see Types
- * @see #getObject
- */
- public final void setObject(String sCol,
- Object x,
+ @Override
+ public final void setObject(String parameterName,
+ Object value,
int targetSqlType,
Integer precision,
int scale) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setObject", new Object[] {sCol, x, targetSqlType, precision, scale});
+ loggerExternal.entering(getClassNameLogging(), "setObject", new Object[] {parameterName, value, targetSqlType, precision, scale});
checkClosed();
// scale - for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types,
@@ -1905,23 +1675,25 @@ public final void setObject(String sCol,
// InputStream and Reader, this is the length of the data in the stream or reader.
// For all other types, this value will be ignored.
- setObject(setterGetParam(findColumn(sCol)), x, JavaType.of(x),
- JDBCType.of(targetSqlType), (java.sql.Types.NUMERIC == targetSqlType || java.sql.Types.DECIMAL == targetSqlType
- || InputStream.class.isInstance(x) || Reader.class.isInstance(x)) ? scale : null,
- precision, false, findColumn(sCol), null);
+ setObject(setterGetParam(findColumn(parameterName)), value, JavaType.of(value), JDBCType.of(targetSqlType),
+ (java.sql.Types.NUMERIC == targetSqlType || java.sql.Types.DECIMAL == targetSqlType || InputStream.class.isInstance(value)
+ || Reader.class.isInstance(value)) ? scale : null,
+ precision, false, findColumn(parameterName), null);
loggerExternal.exiting(getClassNameLogging(), "setObject");
}
+ @Override
public final void setAsciiStream(String parameterName,
- InputStream x) throws SQLException {
+ InputStream value) throws SQLException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setAsciiStream", new Object[] {parameterName, x});
+ loggerExternal.entering(getClassNameLogging(), "setAsciiStream", new Object[] {parameterName, value});
checkClosed();
- setStream(findColumn(parameterName), StreamType.ASCII, x, JavaType.INPUTSTREAM, DataTypes.UNKNOWN_STREAM_LENGTH);
+ setStream(findColumn(parameterName), StreamType.ASCII, value, JavaType.INPUTSTREAM, DataTypes.UNKNOWN_STREAM_LENGTH);
loggerExternal.exiting(getClassNameLogging(), "setAsciiStream");
}
+ @Override
public final void setAsciiStream(String parameterName,
InputStream value,
int length) throws SQLException {
@@ -1932,26 +1704,29 @@ public final void setAsciiStream(String parameterName,
loggerExternal.exiting(getClassNameLogging(), "setAsciiStream");
}
+ @Override
public final void setAsciiStream(String parameterName,
- InputStream x,
+ InputStream value,
long length) throws SQLException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setAsciiStream", new Object[] {parameterName, x, length});
+ loggerExternal.entering(getClassNameLogging(), "setAsciiStream", new Object[] {parameterName, value, length});
checkClosed();
- setStream(findColumn(parameterName), StreamType.ASCII, x, JavaType.INPUTSTREAM, length);
+ setStream(findColumn(parameterName), StreamType.ASCII, value, JavaType.INPUTSTREAM, length);
loggerExternal.exiting(getClassNameLogging(), "setAsciiStream");
}
+ @Override
public final void setBinaryStream(String parameterName,
- InputStream x) throws SQLException {
+ InputStream value) throws SQLException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setBinaryStream", new Object[] {parameterName, x});
+ loggerExternal.entering(getClassNameLogging(), "setBinaryStream", new Object[] {parameterName, value});
checkClosed();
- setStream(findColumn(parameterName), StreamType.BINARY, x, JavaType.INPUTSTREAM, DataTypes.UNKNOWN_STREAM_LENGTH);
+ setStream(findColumn(parameterName), StreamType.BINARY, value, JavaType.INPUTSTREAM, DataTypes.UNKNOWN_STREAM_LENGTH);
loggerExternal.exiting(getClassNameLogging(), "setBinaryStream");
}
+ @Override
public final void setBinaryStream(String parameterName,
InputStream value,
int length) throws SQLException {
@@ -1962,16 +1737,18 @@ public final void setBinaryStream(String parameterName,
loggerExternal.exiting(getClassNameLogging(), "setBinaryStream");
}
+ @Override
public final void setBinaryStream(String parameterName,
- InputStream x,
+ InputStream value,
long length) throws SQLException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setBinaryStream", new Object[] {parameterName, x, length});
+ loggerExternal.entering(getClassNameLogging(), "setBinaryStream", new Object[] {parameterName, value, length});
checkClosed();
- setStream(findColumn(parameterName), StreamType.BINARY, x, JavaType.INPUTSTREAM, length);
+ setStream(findColumn(parameterName), StreamType.BINARY, value, JavaType.INPUTSTREAM, length);
loggerExternal.exiting(getClassNameLogging(), "setBinaryStream");
}
+ @Override
public final void setBlob(String parameterName,
Blob inputStream) throws SQLException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
@@ -1981,9 +1758,9 @@ public final void setBlob(String parameterName,
loggerExternal.exiting(getClassNameLogging(), "setBlob");
}
+ @Override
public final void setBlob(String parameterName,
InputStream value) throws SQLException {
-
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
loggerExternal.entering(getClassNameLogging(), "setBlob", new Object[] {parameterName, value});
checkClosed();
@@ -1991,6 +1768,7 @@ public final void setBlob(String parameterName,
loggerExternal.exiting(getClassNameLogging(), "setBlob");
}
+ @Override
public final void setBlob(String parameterName,
InputStream inputStream,
long length) throws SQLException {
@@ -2001,928 +1779,525 @@ public final void setBlob(String parameterName,
loggerExternal.exiting(getClassNameLogging(), "setBlob");
}
- public void setTimestamp(String sCol,
- java.sql.Timestamp t) throws SQLServerException {
+ @Override
+ public void setTimestamp(String parameterName,
+ java.sql.Timestamp value) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setTimestamp", new Object[] {sCol, t});
+ loggerExternal.entering(getClassNameLogging(), "setTimestamp", new Object[] {parameterName, value});
checkClosed();
- setValue(findColumn(sCol), JDBCType.TIMESTAMP, t, JavaType.TIMESTAMP, false);
+ setValue(findColumn(parameterName), JDBCType.TIMESTAMP, value, JavaType.TIMESTAMP, false);
loggerExternal.exiting(getClassNameLogging(), "setTimestamp");
}
- /**
- * Sets the designated parameter to the given java.sql.Timestamp value. The driver converts this to an SQL TIMESTAMP
- * value when it sends it to the database.
- *
- * @param sCol
- * the name of the parameter
- * @param t
- * the parameter value
- * @param scale
- * the scale of the parameter
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- * @see #getTimestamp
- */
- public void setTimestamp(String sCol,
- java.sql.Timestamp t,
+ @Override
+ public void setTimestamp(String parameterName,
+ java.sql.Timestamp value,
int scale) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setTimestamp", new Object[] {sCol, t});
+ loggerExternal.entering(getClassNameLogging(), "setTimestamp", new Object[] {parameterName, value});
checkClosed();
- setValue(findColumn(sCol), JDBCType.TIMESTAMP, t, JavaType.TIMESTAMP, null, scale, false);
+ setValue(findColumn(parameterName), JDBCType.TIMESTAMP, value, JavaType.TIMESTAMP, null, scale, false);
loggerExternal.exiting(getClassNameLogging(), "setTimestamp");
}
- /**
- * Sets the designated parameter to the given java.sql.Timestamp value. The driver converts this to an SQL TIMESTAMP
- * value when it sends it to the database.
- *
- * @param sCol
- * the name of the parameter
- * @param t
- * the parameter value
- * @param scale
- * the scale of the parameter
- * @param forceEncrypt
- * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
- * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
- * encryption on parameters.
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- * @see #getTimestamp
- */
- public void setTimestamp(String sCol,
- java.sql.Timestamp t,
+ @Override
+ public void setTimestamp(String parameterName,
+ java.sql.Timestamp value,
int scale,
boolean forceEncrypt) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setTimestamp", new Object[] {sCol, t, forceEncrypt});
+ loggerExternal.entering(getClassNameLogging(), "setTimestamp", new Object[] {parameterName, value, forceEncrypt});
checkClosed();
- setValue(findColumn(sCol), JDBCType.TIMESTAMP, t, JavaType.TIMESTAMP, null, scale, forceEncrypt);
+ setValue(findColumn(parameterName), JDBCType.TIMESTAMP, value, JavaType.TIMESTAMP, null, scale, forceEncrypt);
loggerExternal.exiting(getClassNameLogging(), "setTimestamp");
}
- public void setDateTimeOffset(String sCol,
- microsoft.sql.DateTimeOffset t) throws SQLException {
+ @Override
+ public void setDateTimeOffset(String parameterName,
+ microsoft.sql.DateTimeOffset value) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setDateTimeOffset", new Object[] {sCol, t});
+ loggerExternal.entering(getClassNameLogging(), "setDateTimeOffset", new Object[] {parameterName, value});
checkClosed();
- setValue(findColumn(sCol), JDBCType.DATETIMEOFFSET, t, JavaType.DATETIMEOFFSET, false);
+ setValue(findColumn(parameterName), JDBCType.DATETIMEOFFSET, value, JavaType.DATETIMEOFFSET, false);
loggerExternal.exiting(getClassNameLogging(), "setDateTimeOffset");
}
- /**
- * Sets parameter parameterName to DateTimeOffset x
- *
- * @param sCol
- * the name of the parameter
- * @param t
- * DateTimeOffset value
- * @param scale
- * the scale of the parameter
- * @throws SQLException
- * if an error occurs
- */
- public void setDateTimeOffset(String sCol,
- microsoft.sql.DateTimeOffset t,
- int scale) throws SQLException {
+ @Override
+ public void setDateTimeOffset(String parameterName,
+ microsoft.sql.DateTimeOffset value,
+ int scale) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setDateTimeOffset", new Object[] {sCol, t});
+ loggerExternal.entering(getClassNameLogging(), "setDateTimeOffset", new Object[] {parameterName, value});
checkClosed();
- setValue(findColumn(sCol), JDBCType.DATETIMEOFFSET, t, JavaType.DATETIMEOFFSET, null, scale, false);
+ setValue(findColumn(parameterName), JDBCType.DATETIMEOFFSET, value, JavaType.DATETIMEOFFSET, null, scale, false);
loggerExternal.exiting(getClassNameLogging(), "setDateTimeOffset");
}
- /**
- * Sets parameter parameterName to DateTimeOffset x
- *
- * @param sCol
- * the name of the parameter
- * @param t
- * DateTimeOffset value
- * @param scale
- * the scale of the parameter
- * @param forceEncrypt
- * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
- * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
- * encryption on parameters.
- * @throws SQLException
- * if an error occurs
- */
- public void setDateTimeOffset(String sCol,
- microsoft.sql.DateTimeOffset t,
+ @Override
+ public void setDateTimeOffset(String parameterName,
+ microsoft.sql.DateTimeOffset value,
int scale,
- boolean forceEncrypt) throws SQLException {
+ boolean forceEncrypt) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setDateTimeOffset", new Object[] {sCol, t, forceEncrypt});
+ loggerExternal.entering(getClassNameLogging(), "setDateTimeOffset", new Object[] {parameterName, value, forceEncrypt});
checkClosed();
- setValue(findColumn(sCol), JDBCType.DATETIMEOFFSET, t, JavaType.DATETIMEOFFSET, null, scale, forceEncrypt);
+ setValue(findColumn(parameterName), JDBCType.DATETIMEOFFSET, value, JavaType.DATETIMEOFFSET, null, scale, forceEncrypt);
loggerExternal.exiting(getClassNameLogging(), "setDateTimeOffset");
}
- public void setDate(String sCol,
- java.sql.Date d) throws SQLServerException {
+ @Override
+ public void setDate(String parameterName,
+ java.sql.Date value) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setDate", new Object[] {sCol, d});
+ loggerExternal.entering(getClassNameLogging(), "setDate", new Object[] {parameterName, value});
checkClosed();
- setValue(findColumn(sCol), JDBCType.DATE, d, JavaType.DATE, false);
+ setValue(findColumn(parameterName), JDBCType.DATE, value, JavaType.DATE, false);
loggerExternal.exiting(getClassNameLogging(), "setDate");
}
- public void setTime(String sCol,
- java.sql.Time t) throws SQLServerException {
+ @Override
+ public void setTime(String parameterName,
+ java.sql.Time value) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setTime", new Object[] {sCol, t});
+ loggerExternal.entering(getClassNameLogging(), "setTime", new Object[] {parameterName, value});
checkClosed();
- setValue(findColumn(sCol), JDBCType.TIME, t, JavaType.TIME, false);
+ setValue(findColumn(parameterName), JDBCType.TIME, value, JavaType.TIME, false);
loggerExternal.exiting(getClassNameLogging(), "setTime");
}
- /**
- * Sets the designated parameter to the given java.sql.Time value. The driver converts this to an SQL TIME value when it
- * sends it to the database.
- *
- * @param sCol
- * the name of the parameter
- * @param t
- * the parameter value
- * @param scale
- * the scale of the column
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- * @see #getTime
- */
- public void setTime(String sCol,
- java.sql.Time t,
+ @Override
+ public void setTime(String parameterName,
+ java.sql.Time value,
int scale) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setTime", new Object[] {sCol, t});
+ loggerExternal.entering(getClassNameLogging(), "setTime", new Object[] {parameterName, value});
checkClosed();
- setValue(findColumn(sCol), JDBCType.TIME, t, JavaType.TIME, null, scale, false);
+ setValue(findColumn(parameterName), JDBCType.TIME, value, JavaType.TIME, null, scale, false);
loggerExternal.exiting(getClassNameLogging(), "setTime");
}
- /**
- * Sets the designated parameter to the given java.sql.Time value. The driver converts this to an SQL TIME value when it
- * sends it to the database.
- *
- * @param sCol
- * the name of the parameter
- * @param t
- * the parameter value
- * @param scale
- * the scale of the column
- * @param forceEncrypt
- * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
- * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
- * encryption on parameters.
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- * @see #getTime
- */
- public void setTime(String sCol,
- java.sql.Time t,
+ @Override
+ public void setTime(String parameterName,
+ java.sql.Time value,
int scale,
boolean forceEncrypt) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setTime", new Object[] {sCol, t, forceEncrypt});
+ loggerExternal.entering(getClassNameLogging(), "setTime", new Object[] {parameterName, value, forceEncrypt});
checkClosed();
- setValue(findColumn(sCol), JDBCType.TIME, t, JavaType.TIME, null, scale, forceEncrypt);
+ setValue(findColumn(parameterName), JDBCType.TIME, value, JavaType.TIME, null, scale, forceEncrypt);
loggerExternal.exiting(getClassNameLogging(), "setTime");
}
- /**
- * Sets the designated parameter to the given java.sql.Timestamp value. The driver converts this to an SQL DATETIME
- * value when it sends it to the database.
- *
- * @param sCol
- * the name of the parameter
- * @param x
- * the parameter value
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- */
- public void setDateTime(String sCol,
- java.sql.Timestamp x) throws SQLServerException {
+ @Override
+ public void setDateTime(String parameterName,
+ java.sql.Timestamp value) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setDateTime", new Object[] {sCol, x});
+ loggerExternal.entering(getClassNameLogging(), "setDateTime", new Object[] {parameterName, value});
checkClosed();
- setValue(findColumn(sCol), JDBCType.DATETIME, x, JavaType.TIMESTAMP, false);
+ setValue(findColumn(parameterName), JDBCType.DATETIME, value, JavaType.TIMESTAMP, false);
loggerExternal.exiting(getClassNameLogging(), "setDateTime");
}
- /**
- * Sets the designated parameter to the given java.sql.Timestamp value. The driver converts this to an SQL DATETIME
- * value when it sends it to the database.
- *
- * @param sCol
- * the name of the parameter
- * @param x
- * the parameter value
- * @param forceEncrypt
- * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
- * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
- * encryption on parameters.
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- */
- public void setDateTime(String sCol,
- java.sql.Timestamp x,
+ @Override
+ public void setDateTime(String parameterName,
+ java.sql.Timestamp value,
boolean forceEncrypt) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setDateTime", new Object[] {sCol, x, forceEncrypt});
+ loggerExternal.entering(getClassNameLogging(), "setDateTime", new Object[] {parameterName, value, forceEncrypt});
checkClosed();
- setValue(findColumn(sCol), JDBCType.DATETIME, x, JavaType.TIMESTAMP, forceEncrypt);
+ setValue(findColumn(parameterName), JDBCType.DATETIME, value, JavaType.TIMESTAMP, forceEncrypt);
loggerExternal.exiting(getClassNameLogging(), "setDateTime");
}
- /**
- * Sets the designated parameter to the given java.sql.Timestamp value. The driver converts this to an SQL SMALLDATETIME
- * value when it sends it to the database.
- *
- * @param sCol
- * the name of the parameter
- * @param x
- * the parameter value
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- */
- public void setSmallDateTime(String sCol,
- java.sql.Timestamp x) throws SQLServerException {
+ @Override
+ public void setSmallDateTime(String parameterName,
+ java.sql.Timestamp value) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setSmallDateTime", new Object[] {sCol, x});
+ loggerExternal.entering(getClassNameLogging(), "setSmallDateTime", new Object[] {parameterName, value});
checkClosed();
- setValue(findColumn(sCol), JDBCType.SMALLDATETIME, x, JavaType.TIMESTAMP, false);
+ setValue(findColumn(parameterName), JDBCType.SMALLDATETIME, value, JavaType.TIMESTAMP, false);
loggerExternal.exiting(getClassNameLogging(), "setSmallDateTime");
}
- /**
- * Sets the designated parameter to the given java.sql.Timestamp value. The driver converts this to an SQL SMALLDATETIME
- * value when it sends it to the database.
- *
- * @param sCol
- * the name of the parameter
- * @param x
- * the parameter value
- * @param forceEncrypt
- * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
- * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
- * encryption on parameters.
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- */
- public void setSmallDateTime(String sCol,
- java.sql.Timestamp x,
+ @Override
+ public void setSmallDateTime(String parameterName,
+ java.sql.Timestamp value,
boolean forceEncrypt) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setSmallDateTime", new Object[] {sCol, x, forceEncrypt});
+ loggerExternal.entering(getClassNameLogging(), "setSmallDateTime", new Object[] {parameterName, value, forceEncrypt});
checkClosed();
- setValue(findColumn(sCol), JDBCType.SMALLDATETIME, x, JavaType.TIMESTAMP, forceEncrypt);
+ setValue(findColumn(parameterName), JDBCType.SMALLDATETIME, value, JavaType.TIMESTAMP, forceEncrypt);
loggerExternal.exiting(getClassNameLogging(), "setSmallDateTime");
}
- /**
- * Sets the designated parameter to the given String value. The driver converts this to an SQL uniqueIdentifier value
- * when it sends it to the database.
- *
- * @param sCol
- * the name of the parameter
- * @param guid
- * the parameter value
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- */
- public void setUniqueIdentifier(String sCol,
+ @Override
+ public void setUniqueIdentifier(String parameterName,
String guid) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setUniqueIdentifier", new Object[] {sCol, guid});
+ loggerExternal.entering(getClassNameLogging(), "setUniqueIdentifier", new Object[] {parameterName, guid});
checkClosed();
- setValue(findColumn(sCol), JDBCType.GUID, guid, JavaType.STRING, false);
+ setValue(findColumn(parameterName), JDBCType.GUID, guid, JavaType.STRING, false);
loggerExternal.exiting(getClassNameLogging(), "setUniqueIdentifier");
}
- /**
- * Sets the designated parameter to the given String value. The driver converts this to an SQL uniqueIdentifier value
- * when it sends it to the database.
- *
- * @param sCol
- * the name of the parameter
- * @param guid
- * the parameter value
- * @param forceEncrypt
- * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
- * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
- * encryption on parameters.
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- */
- public void setUniqueIdentifier(String sCol,
+ @Override
+ public void setUniqueIdentifier(String parameterName,
String guid,
boolean forceEncrypt) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setUniqueIdentifier", new Object[] {sCol, guid, forceEncrypt});
+ loggerExternal.entering(getClassNameLogging(), "setUniqueIdentifier", new Object[] {parameterName, guid, forceEncrypt});
checkClosed();
- setValue(findColumn(sCol), JDBCType.GUID, guid, JavaType.STRING, forceEncrypt);
+ setValue(findColumn(parameterName), JDBCType.GUID, guid, JavaType.STRING, forceEncrypt);
loggerExternal.exiting(getClassNameLogging(), "setUniqueIdentifier");
}
- public void setBytes(String sCol,
- byte[] b) throws SQLServerException {
+ @Override
+ public void setBytes(String parameterName,
+ byte[] value) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setBytes", new Object[] {sCol, b});
+ loggerExternal.entering(getClassNameLogging(), "setBytes", new Object[] {parameterName, value});
checkClosed();
- setValue(findColumn(sCol), JDBCType.BINARY, b, JavaType.BYTEARRAY, false);
+ setValue(findColumn(parameterName), JDBCType.BINARY, value, JavaType.BYTEARRAY, false);
loggerExternal.exiting(getClassNameLogging(), "setBytes");
}
- /**
- * Sets the designated parameter to the given Java array of bytes. The driver converts this to an SQL VARBINARY or
- * LONGVARBINARY (depending on the argument's size relative to the driver's limits on VARBINARY values) when it sends it
- * to the database.
- *
- * @param sCol
- * the name of the parameter
- * @param b
- * the parameter value
- * @param forceEncrypt
- * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
- * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
- * encryption on parameters.
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- */
- public void setBytes(String sCol,
- byte[] b,
+ @Override
+ public void setBytes(String parameterName,
+ byte[] value,
boolean forceEncrypt) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setBytes", new Object[] {sCol, b, forceEncrypt});
+ loggerExternal.entering(getClassNameLogging(), "setBytes", new Object[] {parameterName, value, forceEncrypt});
checkClosed();
- setValue(findColumn(sCol), JDBCType.BINARY, b, JavaType.BYTEARRAY, forceEncrypt);
+ setValue(findColumn(parameterName), JDBCType.BINARY, value, JavaType.BYTEARRAY, forceEncrypt);
loggerExternal.exiting(getClassNameLogging(), "setBytes");
}
- public void setByte(String sCol,
- byte b) throws SQLServerException {
+ @Override
+ public void setByte(String parameterName,
+ byte value) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setByte", new Object[] {sCol, b});
+ loggerExternal.entering(getClassNameLogging(), "setByte", new Object[] {parameterName, value});
checkClosed();
- setValue(findColumn(sCol), JDBCType.TINYINT, b, JavaType.BYTE, false);
+ setValue(findColumn(parameterName), JDBCType.TINYINT, value, JavaType.BYTE, false);
loggerExternal.exiting(getClassNameLogging(), "setByte");
}
- /**
- * Sets the designated parameter to the given Java byte value. The driver converts this to an SQL TINYINT value when it
- * sends it to the database.
- *
- * @param sCol
- * the name of the parameter
- * @param b
- * the parameter value
- * @param forceEncrypt
- * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
- * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
- * encryption on parameters.
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- */
- public void setByte(String sCol,
- byte b,
+ @Override
+ public void setByte(String parameterName,
+ byte value,
boolean forceEncrypt) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setByte", new Object[] {sCol, b, forceEncrypt});
+ loggerExternal.entering(getClassNameLogging(), "setByte", new Object[] {parameterName, value, forceEncrypt});
checkClosed();
- setValue(findColumn(sCol), JDBCType.TINYINT, b, JavaType.BYTE, forceEncrypt);
+ setValue(findColumn(parameterName), JDBCType.TINYINT, value, JavaType.BYTE, forceEncrypt);
loggerExternal.exiting(getClassNameLogging(), "setByte");
}
- public void setString(String sCol,
- String s) throws SQLServerException {
+ @Override
+ public void setString(String parameterName,
+ String value) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setString", new Object[] {sCol, s});
+ loggerExternal.entering(getClassNameLogging(), "setString", new Object[] {parameterName, value});
checkClosed();
- setValue(findColumn(sCol), JDBCType.VARCHAR, s, JavaType.STRING, false);
+ setValue(findColumn(parameterName), JDBCType.VARCHAR, value, JavaType.STRING, false);
loggerExternal.exiting(getClassNameLogging(), "setString");
}
- /**
- * Sets the designated parameter to the given Java String value. The driver converts this to an SQL VARCHAR or
- * LONGVARCHAR value (depending on the argument's size relative to the driver's limits on VARCHAR values) when it sends
- * it to the database.
- *
- * @param sCol
- * the name of the parameter
- * @param s
- * the parameter value
- * @param forceEncrypt
- * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
- * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
- * encryption on parameters.
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- */
- public void setString(String sCol,
- String s,
+ @Override
+ public void setString(String parameterName,
+ String value,
boolean forceEncrypt) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setString", new Object[] {sCol, s, forceEncrypt});
+ loggerExternal.entering(getClassNameLogging(), "setString", new Object[] {parameterName, value, forceEncrypt});
checkClosed();
- setValue(findColumn(sCol), JDBCType.VARCHAR, s, JavaType.STRING, forceEncrypt);
+ setValue(findColumn(parameterName), JDBCType.VARCHAR, value, JavaType.STRING, forceEncrypt);
loggerExternal.exiting(getClassNameLogging(), "setString");
}
- /**
- * Sets the designated parameter to the given Java java.math.BigDecimal value. The driver converts this to an SQL Money
- * value.
- *
- * @param sCol
- * the name of the parameter
- * @param bd
- * the parameter value
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- */
- public void setMoney(String sCol,
- BigDecimal bd) throws SQLServerException {
+ @Override
+ public void setMoney(String parameterName,
+ BigDecimal value) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setMoney", new Object[] {sCol, bd});
+ loggerExternal.entering(getClassNameLogging(), "setMoney", new Object[] {parameterName, value});
checkClosed();
- setValue(findColumn(sCol), JDBCType.MONEY, bd, JavaType.BIGDECIMAL, false);
+ setValue(findColumn(parameterName), JDBCType.MONEY, value, JavaType.BIGDECIMAL, false);
loggerExternal.exiting(getClassNameLogging(), "setMoney");
}
- /**
- * Sets the designated parameter to the given Java java.math.BigDecimal value. The driver converts this to an SQL Money
- * value.
- *
- * @param sCol
- * the name of the parameter
- * @param bd
- * the parameter value
- * @param forceEncrypt
- * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
- * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
- * encryption on parameters.
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- */
- public void setMoney(String sCol,
- BigDecimal bd,
+ @Override
+ public void setMoney(String parameterName,
+ BigDecimal value,
boolean forceEncrypt) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setMoney", new Object[] {sCol, bd, forceEncrypt});
+ loggerExternal.entering(getClassNameLogging(), "setMoney", new Object[] {parameterName, value, forceEncrypt});
checkClosed();
- setValue(findColumn(sCol), JDBCType.MONEY, bd, JavaType.BIGDECIMAL, forceEncrypt);
+ setValue(findColumn(parameterName), JDBCType.MONEY, value, JavaType.BIGDECIMAL, forceEncrypt);
loggerExternal.exiting(getClassNameLogging(), "setMoney");
}
- /**
- * Sets the designated parameter to the given Java java.math.BigDecimal value. The driver converts this to an SQL
- * smallMoney value.
- *
- * @param sCol
- * the name of the parameter
- * @param bd
- * the parameter value
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- */
- public void setSmallMoney(String sCol,
- BigDecimal bd) throws SQLServerException {
+ @Override
+ public void setSmallMoney(String parameterName,
+ BigDecimal value) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setSmallMoney", new Object[] {sCol, bd});
+ loggerExternal.entering(getClassNameLogging(), "setSmallMoney", new Object[] {parameterName, value});
checkClosed();
- setValue(findColumn(sCol), JDBCType.SMALLMONEY, bd, JavaType.BIGDECIMAL, false);
+ setValue(findColumn(parameterName), JDBCType.SMALLMONEY, value, JavaType.BIGDECIMAL, false);
loggerExternal.exiting(getClassNameLogging(), "setSmallMoney");
}
- /**
- * Sets the designated parameter to the given Java java.math.BigDecimal value. The driver converts this to an SQL
- * smallMoney value.
- *
- * @param sCol
- * the name of the parameter
- * @param bd
- * the parameter value
- * @param forceEncrypt
- * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
- * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
- * encryption on parameters.
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- */
- public void setSmallMoney(String sCol,
- BigDecimal bd,
+ @Override
+ public void setSmallMoney(String parameterName,
+ BigDecimal value,
boolean forceEncrypt) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setSmallMoney", new Object[] {sCol, bd, forceEncrypt});
+ loggerExternal.entering(getClassNameLogging(), "setSmallMoney", new Object[] {parameterName, value, forceEncrypt});
checkClosed();
- setValue(findColumn(sCol), JDBCType.SMALLMONEY, bd, JavaType.BIGDECIMAL, forceEncrypt);
+ setValue(findColumn(parameterName), JDBCType.SMALLMONEY, value, JavaType.BIGDECIMAL, forceEncrypt);
loggerExternal.exiting(getClassNameLogging(), "setSmallMoney");
}
- public void setBigDecimal(String sCol,
- BigDecimal bd) throws SQLServerException {
+ @Override
+ public void setBigDecimal(String parameterName,
+ BigDecimal value) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setBigDecimal", new Object[] {sCol, bd});
+ loggerExternal.entering(getClassNameLogging(), "setBigDecimal", new Object[] {parameterName, value});
checkClosed();
- setValue(findColumn(sCol), JDBCType.DECIMAL, bd, JavaType.BIGDECIMAL, false);
+ setValue(findColumn(parameterName), JDBCType.DECIMAL, value, JavaType.BIGDECIMAL, false);
loggerExternal.exiting(getClassNameLogging(), "setBigDecimal");
}
- /**
- * Sets the designated parameter to the given java.math.BigDecimal value. The driver converts this to an SQL NUMERIC
- * value when it sends it to the database.
- *
- * @param sCol
- * the name of the parameter
- * @param bd
- * the parameter value
- * @param precision
- * the precision of the column
- * @param scale
- * the scale of the column
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- */
- public void setBigDecimal(String sCol,
- BigDecimal bd,
+ @Override
+ public void setBigDecimal(String parameterName,
+ BigDecimal value,
int precision,
int scale) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setBigDecimal", new Object[] {sCol, bd, precision, scale});
+ loggerExternal.entering(getClassNameLogging(), "setBigDecimal", new Object[] {parameterName, value, precision, scale});
checkClosed();
- setValue(findColumn(sCol), JDBCType.DECIMAL, bd, JavaType.BIGDECIMAL, precision, scale, false);
+ setValue(findColumn(parameterName), JDBCType.DECIMAL, value, JavaType.BIGDECIMAL, precision, scale, false);
loggerExternal.exiting(getClassNameLogging(), "setBigDecimal");
}
- /**
- * Sets the designated parameter to the given java.math.BigDecimal value. The driver converts this to an SQL NUMERIC
- * value when it sends it to the database.
- *
- * @param sCol
- * the name of the parameter
- * @param bd
- * the parameter value
- * @param precision
- * the precision of the column
- * @param scale
- * the scale of the column
- * @param forceEncrypt
- * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
- * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
- * encryption on parameters.
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- */
- public void setBigDecimal(String sCol,
- BigDecimal bd,
+ @Override
+ public void setBigDecimal(String parameterName,
+ BigDecimal value,
int precision,
int scale,
boolean forceEncrypt) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setBigDecimal", new Object[] {sCol, bd, precision, scale, forceEncrypt});
+ loggerExternal.entering(getClassNameLogging(), "setBigDecimal", new Object[] {parameterName, value, precision, scale, forceEncrypt});
checkClosed();
- setValue(findColumn(sCol), JDBCType.DECIMAL, bd, JavaType.BIGDECIMAL, precision, scale, forceEncrypt);
+ setValue(findColumn(parameterName), JDBCType.DECIMAL, value, JavaType.BIGDECIMAL, precision, scale, forceEncrypt);
loggerExternal.exiting(getClassNameLogging(), "setBigDecimal");
}
- public void setDouble(String sCol,
- double d) throws SQLServerException {
+ @Override
+ public void setDouble(String parameterName,
+ double value) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setDouble", new Object[] {sCol, d});
+ loggerExternal.entering(getClassNameLogging(), "setDouble", new Object[] {parameterName, value});
checkClosed();
- setValue(findColumn(sCol), JDBCType.DOUBLE, d, JavaType.DOUBLE, false);
+ setValue(findColumn(parameterName), JDBCType.DOUBLE, value, JavaType.DOUBLE, false);
loggerExternal.exiting(getClassNameLogging(), "setDouble");
}
- /**
- * Sets the designated parameter to the given Java double value. The driver converts this to an SQL DOUBLE value when it
- * sends it to the database.
- *
- * @param sCol
- * the name of the parameter
- * @param d
- * the parameter value
- * @param forceEncrypt
- * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
- * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
- * encryption on parameters.
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- */
- public void setDouble(String sCol,
- double d,
+ @Override
+ public void setDouble(String parameterName,
+ double value,
boolean forceEncrypt) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setDouble", new Object[] {sCol, d, forceEncrypt});
+ loggerExternal.entering(getClassNameLogging(), "setDouble", new Object[] {parameterName, value, forceEncrypt});
checkClosed();
- setValue(findColumn(sCol), JDBCType.DOUBLE, d, JavaType.DOUBLE, forceEncrypt);
+ setValue(findColumn(parameterName), JDBCType.DOUBLE, value, JavaType.DOUBLE, forceEncrypt);
loggerExternal.exiting(getClassNameLogging(), "setDouble");
}
- public void setFloat(String sCol,
- float f) throws SQLServerException {
+ @Override
+ public void setFloat(String parameterName,
+ float value) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setFloat", new Object[] {sCol, f});
+ loggerExternal.entering(getClassNameLogging(), "setFloat", new Object[] {parameterName, value});
checkClosed();
- setValue(findColumn(sCol), JDBCType.REAL, f, JavaType.FLOAT, false);
+ setValue(findColumn(parameterName), JDBCType.REAL, value, JavaType.FLOAT, false);
loggerExternal.exiting(getClassNameLogging(), "setFloat");
}
- /**
- * Sets the designated parameter to the given Java float value. The driver converts this to an SQL FLOAT value when it
- * sends it to the database.
- *
- * @param sCol
- * the name of the parameter
- * @param f
- * the parameter value
- * @param forceEncrypt
- * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
- * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
- * encryption on parameters.
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- */
- public void setFloat(String sCol,
- float f,
+ @Override
+ public void setFloat(String parameterName,
+ float value,
boolean forceEncrypt) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setFloat", new Object[] {sCol, f, forceEncrypt});
+ loggerExternal.entering(getClassNameLogging(), "setFloat", new Object[] {parameterName, value, forceEncrypt});
checkClosed();
- setValue(findColumn(sCol), JDBCType.REAL, f, JavaType.FLOAT, forceEncrypt);
+ setValue(findColumn(parameterName), JDBCType.REAL, value, JavaType.FLOAT, forceEncrypt);
loggerExternal.exiting(getClassNameLogging(), "setFloat");
}
- public void setInt(String sCol,
- int i) throws SQLServerException {
+ @Override
+ public void setInt(String parameterName,
+ int value) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setInt", new Object[] {sCol, i});
+ loggerExternal.entering(getClassNameLogging(), "setInt", new Object[] {parameterName, value});
checkClosed();
- setValue(findColumn(sCol), JDBCType.INTEGER, i, JavaType.INTEGER, false);
+ setValue(findColumn(parameterName), JDBCType.INTEGER, value, JavaType.INTEGER, false);
loggerExternal.exiting(getClassNameLogging(), "setInt");
}
- /**
- * Sets the designated parameter to the given Java int value. The driver converts this to an SQL INTEGER value when it
- * sends it to the database.
- *
- * @param sCol
- * the name of the parameter
- * @param i
- * the parameter value
- * @param forceEncrypt
- * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
- * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
- * encryption on parameters.
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- */
- public void setInt(String sCol,
- int i,
+ @Override
+ public void setInt(String parameterName,
+ int value,
boolean forceEncrypt) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setInt", new Object[] {sCol, i, forceEncrypt});
+ loggerExternal.entering(getClassNameLogging(), "setInt", new Object[] {parameterName, value, forceEncrypt});
checkClosed();
- setValue(findColumn(sCol), JDBCType.INTEGER, i, JavaType.INTEGER, forceEncrypt);
+ setValue(findColumn(parameterName), JDBCType.INTEGER, value, JavaType.INTEGER, forceEncrypt);
loggerExternal.exiting(getClassNameLogging(), "setInt");
}
- public void setLong(String sCol,
- long l) throws SQLServerException {
+ @Override
+ public void setLong(String parameterName,
+ long value) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setLong", new Object[] {sCol, l});
+ loggerExternal.entering(getClassNameLogging(), "setLong", new Object[] {parameterName, value});
checkClosed();
- setValue(findColumn(sCol), JDBCType.BIGINT, l, JavaType.LONG, false);
+ setValue(findColumn(parameterName), JDBCType.BIGINT, value, JavaType.LONG, false);
loggerExternal.exiting(getClassNameLogging(), "setLong");
}
- /**
- * Sets the designated parameter to the given Java long value. The driver converts this to an SQL BIGINT value when it
- * sends it to the database.
- *
- * @param sCol
- * the name of the parameter
- * @param l
- * the parameter value
- * @param forceEncrypt
- * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
- * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
- * encryption on parameters.
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- */
- public void setLong(String sCol,
- long l,
+ @Override
+ public void setLong(String parameterName,
+ long value,
boolean forceEncrypt) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setLong", new Object[] {sCol, l, forceEncrypt});
+ loggerExternal.entering(getClassNameLogging(), "setLong", new Object[] {parameterName, value, forceEncrypt});
checkClosed();
- setValue(findColumn(sCol), JDBCType.BIGINT, l, JavaType.LONG, forceEncrypt);
+ setValue(findColumn(parameterName), JDBCType.BIGINT, value, JavaType.LONG, forceEncrypt);
loggerExternal.exiting(getClassNameLogging(), "setLong");
}
- public void setShort(String sCol,
- short s) throws SQLServerException {
+ @Override
+ public void setShort(String parameterName,
+ short value) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setShort", new Object[] {sCol, s});
+ loggerExternal.entering(getClassNameLogging(), "setShort", new Object[] {parameterName, value});
checkClosed();
- setValue(findColumn(sCol), JDBCType.SMALLINT, s, JavaType.SHORT, false);
+ setValue(findColumn(parameterName), JDBCType.SMALLINT, value, JavaType.SHORT, false);
loggerExternal.exiting(getClassNameLogging(), "setShort");
}
- /**
- * Sets the designated parameter to the given Java short value. The driver converts this to an SQL SMALLINT value when
- * it sends it to the database.
- *
- * @param sCol
- * the name of the parameter
- * @param s
- * the parameter value
- * @param forceEncrypt
- * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
- * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
- * encryption on parameters.
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- */
- public void setShort(String sCol,
- short s,
+ @Override
+ public void setShort(String parameterName,
+ short value,
boolean forceEncrypt) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setShort", new Object[] {sCol, s, forceEncrypt});
+ loggerExternal.entering(getClassNameLogging(), "setShort", new Object[] {parameterName, value, forceEncrypt});
checkClosed();
- setValue(findColumn(sCol), JDBCType.SMALLINT, s, JavaType.SHORT, forceEncrypt);
+ setValue(findColumn(parameterName), JDBCType.SMALLINT, value, JavaType.SHORT, forceEncrypt);
loggerExternal.exiting(getClassNameLogging(), "setShort");
}
- public void setBoolean(String sCol,
- boolean b) throws SQLServerException {
+ @Override
+ public void setBoolean(String parameterName,
+ boolean value) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setBoolean", new Object[] {sCol, b});
+ loggerExternal.entering(getClassNameLogging(), "setBoolean", new Object[] {parameterName, value});
checkClosed();
- setValue(findColumn(sCol), JDBCType.BIT, b, JavaType.BOOLEAN, false);
+ setValue(findColumn(parameterName), JDBCType.BIT, value, JavaType.BOOLEAN, false);
loggerExternal.exiting(getClassNameLogging(), "setBoolean");
}
- /**
- * Sets the designated parameter to the given Java boolean value. The driver converts this to an SQL BIT or
- * BOOLEAN value when it sends it to the database.
- *
- * @param sCol
- * the name of the parameter
- * @param b
- * the parameter value
- * @param forceEncrypt
- * If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
- * Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
- * encryption on parameters.
- * @throws SQLServerException
- * if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed
- * CallableStatement
- */
- public void setBoolean(String sCol,
- boolean b,
+ @Override
+ public void setBoolean(String parameterName,
+ boolean value,
boolean forceEncrypt) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setBoolean", new Object[] {sCol, b, forceEncrypt});
+ loggerExternal.entering(getClassNameLogging(), "setBoolean", new Object[] {parameterName, value, forceEncrypt});
checkClosed();
- setValue(findColumn(sCol), JDBCType.BIT, b, JavaType.BOOLEAN, forceEncrypt);
+ setValue(findColumn(parameterName), JDBCType.BIT, value, JavaType.BOOLEAN, forceEncrypt);
loggerExternal.exiting(getClassNameLogging(), "setBoolean");
}
- public void setNull(String sCol,
+ @Override
+ public void setNull(String parameterName,
int nType) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setNull", new Object[] {sCol, nType});
+ loggerExternal.entering(getClassNameLogging(), "setNull", new Object[] {parameterName, nType});
checkClosed();
- setObject(setterGetParam(findColumn(sCol)), null, JavaType.OBJECT, JDBCType.of(nType), null, null, false, findColumn(sCol), null);
+ setObject(setterGetParam(findColumn(parameterName)), null, JavaType.OBJECT, JDBCType.of(nType), null, null, false, findColumn(parameterName),
+ null);
loggerExternal.exiting(getClassNameLogging(), "setNull");
}
- public void setNull(String sCol,
+ @Override
+ public void setNull(String parameterName,
int nType,
String sTypeName) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setNull", new Object[] {sCol, nType, sTypeName});
+ loggerExternal.entering(getClassNameLogging(), "setNull", new Object[] {parameterName, nType, sTypeName});
checkClosed();
- setObject(setterGetParam(findColumn(sCol)), null, JavaType.OBJECT, JDBCType.of(nType), null, null, false, findColumn(sCol), sTypeName);
+ setObject(setterGetParam(findColumn(parameterName)), null, JavaType.OBJECT, JDBCType.of(nType), null, null, false, findColumn(parameterName),
+ sTypeName);
loggerExternal.exiting(getClassNameLogging(), "setNull");
}
- public void setURL(String sCol,
- URL u) throws SQLServerException {
- loggerExternal.entering(getClassNameLogging(), "setURL", sCol);
+ @Override
+ public void setURL(String parameterName,
+ URL url) throws SQLException {
+ loggerExternal.entering(getClassNameLogging(), "setURL", parameterName);
checkClosed();
- setURL(findColumn(sCol), u);
+ setURL(findColumn(parameterName), url);
loggerExternal.exiting(getClassNameLogging(), "setURL");
}
- /**
- * Populates a table valued parameter passed to a stored procedure with a data table.
- *
- * @param sCol
- * the name of the parameter
- * @param tvpName
- * the name of the type TVP
- * @param tvpDataTable
- * the data table object
- * @throws SQLServerException
- * when an error occurs
- */
- public final void setStructured(String sCol,
+ @Override
+ public final void setStructured(String parameterName,
String tvpName,
SQLServerDataTable tvpDataTable) throws SQLServerException {
- tvpName = getTVPNameIfNull(findColumn(sCol), tvpName);
+ tvpName = getTVPNameIfNull(findColumn(parameterName), tvpName);
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setStructured", new Object[] {sCol, tvpName, tvpDataTable});
+ loggerExternal.entering(getClassNameLogging(), "setStructured", new Object[] {parameterName, tvpName, tvpDataTable});
checkClosed();
- setValue(findColumn(sCol), JDBCType.TVP, tvpDataTable, JavaType.TVP, tvpName);
+ setValue(findColumn(parameterName), JDBCType.TVP, tvpDataTable, JavaType.TVP, tvpName);
loggerExternal.exiting(getClassNameLogging(), "setStructured");
}
- /**
- * Populates a table valued parameter passed to a stored procedure with a ResultSet retrieved from another table
- *
- * @param sCol
- * the name of the parameter
- * @param tvpName
- * the name of the type TVP
- * @param tvpResultSet
- * the source result set object
- * @throws SQLServerException
- * when an error occurs
- */
- public final void setStructured(String sCol,
+ @Override
+ public final void setStructured(String parameterName,
String tvpName,
ResultSet tvpResultSet) throws SQLServerException {
- tvpName = getTVPNameIfNull(findColumn(sCol), tvpName);
+ tvpName = getTVPNameIfNull(findColumn(parameterName), tvpName);
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setStructured", new Object[] {sCol, tvpName, tvpResultSet});
+ loggerExternal.entering(getClassNameLogging(), "setStructured", new Object[] {parameterName, tvpName, tvpResultSet});
checkClosed();
- setValue(findColumn(sCol), JDBCType.TVP, tvpResultSet, JavaType.TVP, tvpName);
+ setValue(findColumn(parameterName), JDBCType.TVP, tvpResultSet, JavaType.TVP, tvpName);
loggerExternal.exiting(getClassNameLogging(), "setStructured");
}
- /**
- * Populates a table valued parameter passed to a stored procedure with an ISQLServerDataRecord object.
- *
- * @param sCol
- * the name of the parameter
- * @param tvpName
- * the name of the type TVP
- * @param tvpDataRecord
- * ISQLServerDataRecord is used for streaming data and the user decides how to use it. tvpDataRecord is an ISQLServerDataRecord
- * object.the source result set object
- * @throws SQLServerException
- * when an error occurs
- */
- public final void setStructured(String sCol,
+ @Override
+ public final void setStructured(String parameterName,
String tvpName,
ISQLServerDataRecord tvpDataRecord) throws SQLServerException {
- tvpName = getTVPNameIfNull(findColumn(sCol), tvpName);
+ tvpName = getTVPNameIfNull(findColumn(parameterName), tvpName);
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setStructured", new Object[] {sCol, tvpName, tvpDataRecord});
+ loggerExternal.entering(getClassNameLogging(), "setStructured", new Object[] {parameterName, tvpName, tvpDataRecord});
checkClosed();
- setValue(findColumn(sCol), JDBCType.TVP, tvpDataRecord, JavaType.TVP, tvpName);
+ setValue(findColumn(parameterName), JDBCType.TVP, tvpDataRecord, JavaType.TVP, tvpName);
loggerExternal.exiting(getClassNameLogging(), "setStructured");
}
- public URL getURL(int n) throws SQLServerException {
- NotImplemented();
+ @Override
+ public URL getURL(int parameterIndex) throws SQLException {
+ SQLServerException.throwNotSupportedException(connection, this);
return null;
}
- public URL getURL(String s) throws SQLServerException {
- NotImplemented();
+ @Override
+ public URL getURL(String parameterName) throws SQLException {
+ SQLServerException.throwNotSupportedException(connection, this);
return null;
}
+ @Override
public final void setSQLXML(String parameterName,
SQLXML xmlObject) throws SQLException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
@@ -2932,6 +2307,7 @@ public final void setSQLXML(String parameterName,
loggerExternal.exiting(getClassNameLogging(), "setSQLXML");
}
+ @Override
public final SQLXML getSQLXML(int parameterIndex) throws SQLException {
loggerExternal.entering(getClassNameLogging(), "getSQLXML", parameterIndex);
checkClosed();
@@ -2940,6 +2316,7 @@ public final SQLXML getSQLXML(int parameterIndex) throws SQLException {
return value;
}
+ @Override
public final SQLXML getSQLXML(String parameterName) throws SQLException {
loggerExternal.entering(getClassNameLogging(), "getSQLXML", parameterName);
checkClosed();
@@ -2948,65 +2325,211 @@ public final SQLXML getSQLXML(String parameterName) throws SQLException {
return value;
}
+ @Override
public final void setRowId(String parameterName,
- RowId x) throws SQLException {
-
- // Not implemented
- throw new SQLFeatureNotSupportedException(SQLServerException.getErrString("R_notSupported"));
+ RowId value) throws SQLException {
+ SQLServerException.throwNotSupportedException(connection, this);
}
+ @Override
public final RowId getRowId(int parameterIndex) throws SQLException {
-
- // Not implemented
- throw new SQLFeatureNotSupportedException(SQLServerException.getErrString("R_notSupported"));
+ SQLServerException.throwNotSupportedException(connection, this);
+ return null;
}
+ @Override
public final RowId getRowId(String parameterName) throws SQLException {
-
- // Not implemented
- throw new SQLFeatureNotSupportedException(SQLServerException.getErrString("R_notSupported"));
+ SQLServerException.throwNotSupportedException(connection, this);
+ return null;
}
- public void registerOutParameter(String s,
- int n,
- String s1) throws SQLServerException {
+ @Override
+ public void registerOutParameter(String parameterName,
+ int sqlType,
+ String typeName) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "registerOutParameter", new Object[] {s, n, s1});
+ loggerExternal.entering(getClassNameLogging(), "registerOutParameter", new Object[] {parameterName, sqlType, typeName});
checkClosed();
- registerOutParameter(findColumn(s), n, s1);
+ registerOutParameter(findColumn(parameterName), sqlType, typeName);
loggerExternal.exiting(getClassNameLogging(), "registerOutParameter");
}
+ @Override
public void registerOutParameter(String parameterName,
int sqlType,
int scale) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "registerOutParameter",
- new Object[] {parameterName, sqlType, scale});
+ loggerExternal.entering(getClassNameLogging(), "registerOutParameter", new Object[] {parameterName, sqlType, scale});
checkClosed();
registerOutParameter(findColumn(parameterName), sqlType, scale);
loggerExternal.exiting(getClassNameLogging(), "registerOutParameter");
}
+ @Override
public void registerOutParameter(String parameterName,
int sqlType,
int precision,
int scale) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "registerOutParameter",
- new Object[] {parameterName, sqlType, scale});
+ loggerExternal.entering(getClassNameLogging(), "registerOutParameter", new Object[] {parameterName, sqlType, scale});
checkClosed();
registerOutParameter(findColumn(parameterName), sqlType, precision, scale);
loggerExternal.exiting(getClassNameLogging(), "registerOutParameter");
}
- public void registerOutParameter(String s,
- int n) throws SQLServerException {
+ @Override
+ public void registerOutParameter(String parameterName,
+ int sqlType) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "registerOutParameter", new Object[] {s, n});
+ loggerExternal.entering(getClassNameLogging(), "registerOutParameter", new Object[] {parameterName, sqlType});
checkClosed();
- registerOutParameter(findColumn(s), n);
+ registerOutParameter(findColumn(parameterName), sqlType);
+ loggerExternal.exiting(getClassNameLogging(), "registerOutParameter");
+ }
+
+ @Override
+ public void registerOutParameter(int paramterIndex,
+ SQLType sqlType) throws SQLServerException {
+
+ if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
+ loggerExternal.entering(getClassNameLogging(), "registerOutParameter", new Object[] {paramterIndex, sqlType});
+
+ // getVendorTypeNumber() returns the same constant integer values as in java.sql.Types
+ registerOutParameter(paramterIndex, sqlType.getVendorTypeNumber());
+ loggerExternal.exiting(getClassNameLogging(), "registerOutParameter");
+ }
+
+ @Override
+ public void registerOutParameter(int paramterIndex,
+ SQLType sqlType,
+ String typeName) throws SQLServerException {
+
+ if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
+ loggerExternal.entering(getClassNameLogging(), "registerOutParameter", new Object[] {paramterIndex, sqlType, typeName});
+
+ // getVendorTypeNumber() returns the same constant integer values as in java.sql.Types
+ registerOutParameter(paramterIndex, sqlType.getVendorTypeNumber(), typeName);
+ loggerExternal.exiting(getClassNameLogging(), "registerOutParameter");
+ }
+
+ @Override
+ public void registerOutParameter(int paramterIndex,
+ SQLType sqlType,
+ int scale) throws SQLServerException {
+
+ if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
+ loggerExternal.entering(getClassNameLogging(), "registerOutParameter", new Object[] {paramterIndex, sqlType, scale});
+
+ // getVendorTypeNumber() returns the same constant integer values as in java.sql.Types
+ registerOutParameter(paramterIndex, sqlType.getVendorTypeNumber(), scale);
+ loggerExternal.exiting(getClassNameLogging(), "registerOutParameter");
+ }
+
+ @Override
+ public void registerOutParameter(int paramterIndex,
+ SQLType sqlType,
+ int precision,
+ int scale) throws SQLServerException {
+
+ if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
+ loggerExternal.entering(getClassNameLogging(), "registerOutParameter", new Object[] {paramterIndex, sqlType, scale});
+
+ // getVendorTypeNumber() returns the same constant integer values as in java.sql.Types
+ registerOutParameter(paramterIndex, sqlType.getVendorTypeNumber(), precision, scale);
loggerExternal.exiting(getClassNameLogging(), "registerOutParameter");
}
+ @Override
+ public void setObject(String parameterName,
+ Object value,
+ SQLType jdbcType) throws SQLServerException {
+
+ if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
+ loggerExternal.entering(getClassNameLogging(), "setObject", new Object[] {parameterName, value, jdbcType});
+
+ // getVendorTypeNumber() returns the same constant integer values as in java.sql.Types
+ setObject(parameterName, value, jdbcType.getVendorTypeNumber());
+ loggerExternal.exiting(getClassNameLogging(), "setObject");
+ }
+
+ @Override
+ public void setObject(String parameterName,
+ Object value,
+ SQLType jdbcType,
+ int scale) throws SQLServerException {
+
+ if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
+ loggerExternal.entering(getClassNameLogging(), "setObject", new Object[] {parameterName, value, jdbcType, scale});
+
+ // getVendorTypeNumber() returns the same constant integer values as in java.sql.Types
+ setObject(parameterName, value, jdbcType.getVendorTypeNumber(), scale);
+ loggerExternal.exiting(getClassNameLogging(), "setObject");
+ }
+
+ @Override
+ public void setObject(String parameterName,
+ Object value,
+ SQLType jdbcType,
+ int scale,
+ boolean forceEncrypt) throws SQLServerException {
+
+ if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
+ loggerExternal.entering(getClassNameLogging(), "setObject", new Object[] {parameterName, value, jdbcType, scale, forceEncrypt});
+
+ // getVendorTypeNumber() returns the same constant integer values as in java.sql.Types
+ setObject(parameterName, value, jdbcType.getVendorTypeNumber(), scale, forceEncrypt);
+ loggerExternal.exiting(getClassNameLogging(), "setObject");
+ }
+
+ @Override
+ public void registerOutParameter(String parameterName,
+ SQLType sqlType,
+ String typeName) throws SQLServerException {
+
+ if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
+ loggerExternal.entering(getClassNameLogging(), "registerOutParameter", new Object[] {parameterName, sqlType, typeName});
+
+ // getVendorTypeNumber() returns the same constant integer values as in java.sql.Types
+ registerOutParameter(parameterName, sqlType.getVendorTypeNumber(), typeName);
+ loggerExternal.exiting(getClassNameLogging(), "registerOutParameter");
+ }
+
+ @Override
+ public void registerOutParameter(String parameterName,
+ SQLType sqlType,
+ int scale) throws SQLServerException {
+
+ if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
+ loggerExternal.entering(getClassNameLogging(), "registerOutParameter", new Object[] {parameterName, sqlType, scale});
+
+ // getVendorTypeNumber() returns the same constant integer values as in java.sql.Types
+ registerOutParameter(parameterName, sqlType.getVendorTypeNumber(), scale);
+ loggerExternal.exiting(getClassNameLogging(), "registerOutParameter");
+ }
+
+ @Override
+ public void registerOutParameter(String parameterName,
+ SQLType sqlType,
+ int precision,
+ int scale) throws SQLServerException {
+
+ if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
+ loggerExternal.entering(getClassNameLogging(), "registerOutParameter", new Object[] {parameterName, sqlType, scale});
+
+ // getVendorTypeNumber() returns the same constant integer values as in java.sql.Types
+ registerOutParameter(parameterName, sqlType.getVendorTypeNumber(), precision, scale);
+ loggerExternal.exiting(getClassNameLogging(), "registerOutParameter");
+ }
+
+ @Override
+ public void registerOutParameter(String parameterName,
+ SQLType sqlType) throws SQLServerException {
+
+ if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
+ loggerExternal.entering(getClassNameLogging(), "registerOutParameter", new Object[] {parameterName, sqlType});
+
+ // getVendorTypeNumber() returns the same constant integer values as in java.sql.Types
+ registerOutParameter(parameterName, sqlType.getVendorTypeNumber());
+ loggerExternal.exiting(getClassNameLogging(), "registerOutParameter");
+ }
}
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement42.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement42.java
deleted file mode 100644
index cf5e1f246..000000000
--- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement42.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Microsoft JDBC Driver for SQL Server
- *
- * Copyright(c) Microsoft Corporation All rights reserved.
- *
- * This program is made available under the terms of the MIT License. See the LICENSE file in the project root for more information.
- */
-
-package com.microsoft.sqlserver.jdbc;
-
-import java.sql.SQLType;
-
-/**
- *
- * This class is separated from SQLServerCallableStatement class in order to resolve compiling error of missing Java 8 Types when running with Java 7.
- *
- * This class will be initialized instead of SQLServerCallableStatement when Java 8 and JDBC 4.2 are used.
- *
- * It shares the same PreparedStatement implementation with SQLServerPreparedStatement42.
- *
- */
-public class SQLServerCallableStatement42 extends SQLServerCallableStatement implements ISQLServerCallableStatement42 {
-
- SQLServerCallableStatement42(SQLServerConnection connection,
- String sql,
- int nRSType,
- int nRSConcur,
- SQLServerStatementColumnEncryptionSetting stmtColEncSetting) throws SQLServerException {
- super(connection, sql, nRSType, nRSConcur, stmtColEncSetting);
- }
-
- public void registerOutParameter(int index,
- SQLType sqlType) throws SQLServerException {
- DriverJDBCVersion.checkSupportsJDBC42();
-
- if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "registerOutParameter", new Object[] {index, sqlType});
-
- // getVendorTypeNumber() returns the same constant integer values as in java.sql.Types
- registerOutParameter(index, sqlType.getVendorTypeNumber());
- loggerExternal.exiting(getClassNameLogging(), "registerOutParameter");
- }
-
- public void registerOutParameter(int index,
- SQLType sqlType,
- String typeName) throws SQLServerException {
- DriverJDBCVersion.checkSupportsJDBC42();
-
- if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "registerOutParameter", new Object[] {index, sqlType, typeName});
-
- // getVendorTypeNumber() returns the same constant integer values as in java.sql.Types
- registerOutParameter(index, sqlType.getVendorTypeNumber(), typeName);
-
- loggerExternal.exiting(getClassNameLogging(), "registerOutParameter");
- }
-
- public void registerOutParameter(int index,
- SQLType sqlType,
- int scale) throws SQLServerException {
- DriverJDBCVersion.checkSupportsJDBC42();
-
- if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "registerOutParameter", new Object[] {index, sqlType, scale});
-
- // getVendorTypeNumber() returns the same constant integer values as in java.sql.Types
- registerOutParameter(index, sqlType.getVendorTypeNumber(), scale);
-
- loggerExternal.exiting(getClassNameLogging(), "registerOutParameter");
- }
-
- public void registerOutParameter(int index,
- SQLType sqlType,
- int precision,
- int scale) throws SQLServerException {
- DriverJDBCVersion.checkSupportsJDBC42();
-
- if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "registerOutParameter", new Object[] {index, sqlType, scale});
-
- // getVendorTypeNumber() returns the same constant integer values as in java.sql.Types
- registerOutParameter(index, sqlType.getVendorTypeNumber(), precision, scale);
-
- loggerExternal.exiting(getClassNameLogging(), "registerOutParameter");
- }
-
- public void setObject(String sCol,
- Object obj,
- SQLType jdbcType) throws SQLServerException {
- DriverJDBCVersion.checkSupportsJDBC42();
-
- if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setObject", new Object[] {sCol, obj, jdbcType});
-
- // getVendorTypeNumber() returns the same constant integer values as in java.sql.Types
- setObject(sCol, obj, jdbcType.getVendorTypeNumber());
-
- loggerExternal.exiting(getClassNameLogging(), "setObject");
- }
-
- public void setObject(String sCol,
- Object obj,
- SQLType jdbcType,
- int scale) throws SQLServerException {
- DriverJDBCVersion.checkSupportsJDBC42();
-
- if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setObject", new Object[] {sCol, obj, jdbcType, scale});
-
- // getVendorTypeNumber() returns the same constant integer values as in java.sql.Types
- setObject(sCol, obj, jdbcType.getVendorTypeNumber(), scale);
-
- loggerExternal.exiting(getClassNameLogging(), "setObject");
- }
-
- public void setObject(String sCol,
- Object obj,
- SQLType jdbcType,
- int scale,
- boolean forceEncrypt) throws SQLServerException {
- DriverJDBCVersion.checkSupportsJDBC42();
-
- if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "setObject", new Object[] {sCol, obj, jdbcType, scale, forceEncrypt});
-
- // getVendorTypeNumber() returns the same constant integer values as in java.sql.Types
- setObject(sCol, obj, jdbcType.getVendorTypeNumber(), scale, forceEncrypt);
-
- loggerExternal.exiting(getClassNameLogging(), "setObject");
- }
-
- public void registerOutParameter(String parameterName,
- SQLType sqlType,
- String typeName) throws SQLServerException {
- DriverJDBCVersion.checkSupportsJDBC42();
-
- if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "registerOutParameter", new Object[] {parameterName, sqlType, typeName});
-
- // getVendorTypeNumber() returns the same constant integer values as in java.sql.Types
- registerOutParameter(parameterName, sqlType.getVendorTypeNumber(), typeName);
-
- loggerExternal.exiting(getClassNameLogging(), "registerOutParameter");
- }
-
- public void registerOutParameter(String parameterName,
- SQLType sqlType,
- int scale) throws SQLServerException {
- DriverJDBCVersion.checkSupportsJDBC42();
-
- if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "registerOutParameter", new Object[] {parameterName, sqlType, scale});
-
- // getVendorTypeNumber() returns the same constant integer values as in java.sql.Types
- registerOutParameter(parameterName, sqlType.getVendorTypeNumber(), scale);
-
- loggerExternal.exiting(getClassNameLogging(), "registerOutParameter");
- }
-
- public void registerOutParameter(String parameterName,
- SQLType sqlType,
- int precision,
- int scale) throws SQLServerException {
- DriverJDBCVersion.checkSupportsJDBC42();
-
- if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "registerOutParameter", new Object[] {parameterName, sqlType, scale});
-
- // getVendorTypeNumber() returns the same constant integer values as in java.sql.Types
- registerOutParameter(parameterName, sqlType.getVendorTypeNumber(), precision, scale);
-
- loggerExternal.exiting(getClassNameLogging(), "registerOutParameter");
- }
-
- public void registerOutParameter(String parameterName,
- SQLType sqlType) throws SQLServerException {
- DriverJDBCVersion.checkSupportsJDBC42();
-
- if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
- loggerExternal.entering(getClassNameLogging(), "registerOutParameter", new Object[] {parameterName, sqlType});
-
- // getVendorTypeNumber() returns the same constant integer values as in java.sql.Types
- registerOutParameter(parameterName, sqlType.getVendorTypeNumber());
-
- loggerExternal.exiting(getClassNameLogging(), "registerOutParameter");
- }
-
- public final void setObject(int index,
- Object obj,
- SQLType jdbcType) throws SQLServerException {
- SQLServerPreparedStatement42Helper.setObject(this, index, obj, jdbcType);
- }
-
- public final void setObject(int parameterIndex,
- Object x,
- SQLType targetSqlType,
- int scaleOrLength) throws SQLServerException {
- SQLServerPreparedStatement42Helper.setObject(this, parameterIndex, x, targetSqlType, scaleOrLength);
- }
-
- public final void setObject(int parameterIndex,
- Object x,
- SQLType targetSqlType,
- Integer precision,
- Integer scale) throws SQLServerException {
- SQLServerPreparedStatement42Helper.setObject(this, parameterIndex, x, targetSqlType, precision, scale);
- }
-
- public final void setObject(int parameterIndex,
- Object x,
- SQLType targetSqlType,
- Integer precision,
- Integer scale,
- boolean forceEncrypt) throws SQLServerException {
- SQLServerPreparedStatement42Helper.setObject(this, parameterIndex, x, targetSqlType, precision, scale, forceEncrypt);
- }
-
-}
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerClob.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerClob.java
index 137361dcb..31b8d0837 100644
--- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerClob.java
+++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerClob.java
@@ -17,10 +17,12 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
+import java.io.OutputStream;
import java.io.Reader;
import java.io.Serializable;
import java.io.StringReader;
import java.io.UnsupportedEncodingException;
+import java.io.Writer;
import java.sql.Clob;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
@@ -35,9 +37,13 @@
*/
public class SQLServerClob extends SQLServerClobBase implements Clob {
+ /**
+ * Always refresh SerialVersionUID when prompted
+ */
private static final long serialVersionUID = 2872035282200133865L;
-
- // Loggers should be class static to avoid lock contention with multiple threads
+
+ // Loggers should be class static to avoid lock contention with multiple
+ // threads
private static final Logger logger = Logger.getLogger("com.microsoft.sqlserver.jdbc.internals.SQLServerClob");
/**
@@ -67,12 +73,94 @@ public SQLServerClob(SQLServerConnection connection,
super(null, stream, typeInfo.getSQLCollation(), logger, typeInfo);
}
+ @Override
+ public void free() throws SQLException {
+ super.free();
+ }
+
+ @Override
+ public InputStream getAsciiStream() throws SQLException {
+ return super.getAsciiStream();
+ }
+
+ @Override
+ public Reader getCharacterStream() throws SQLException {
+ return super.getCharacterStream();
+ }
+
+ @Override
+ public Reader getCharacterStream(long pos,
+ long length) throws SQLException {
+ return super.getCharacterStream(pos, length);
+ }
+
+ @Override
+ public String getSubString(long pos,
+ int length) throws SQLException {
+ return super.getSubString(pos, length);
+ }
+
+ @Override
+ public long length() throws SQLException {
+ return super.length();
+ }
+
+ @Override
+ void fillFromStream() throws SQLException {
+ super.fillFromStream();
+ }
+
+ @Override
+ public long position(Clob searchstr,
+ long start) throws SQLException {
+ return super.position(searchstr, start);
+ }
+
+ @Override
+ public long position(String searchstr,
+ long start) throws SQLException {
+ return super.position(searchstr, start);
+ }
+
+ @Override
+ public void truncate(long len) throws SQLException {
+ super.truncate(len);
+ }
+
+ @Override
+ public OutputStream setAsciiStream(long pos) throws SQLException {
+ return super.setAsciiStream(pos);
+ }
+
+ @Override
+ public Writer setCharacterStream(long pos) throws SQLException {
+ return super.setCharacterStream(pos);
+ }
+
+ @Override
+ public int setString(long pos,
+ String s) throws SQLException {
+ return super.setString(pos, s);
+ }
+
+ @Override
+ public int setString(long pos,
+ String str,
+ int offset,
+ int len) throws SQLException {
+ return super.setString(pos, str, offset, len);
+ }
+
+ @Override
final JDBCType getJdbcType() {
return JDBCType.CLOB;
}
}
abstract class SQLServerClobBase extends SQLServerLob implements Serializable {
+ /**
+ * Always refresh SerialVersionUID when prompted
+ */
private static final long serialVersionUID = 8691072211054430124L;
// The value of the CLOB that this Clob object represents.
@@ -82,27 +170,31 @@ abstract class SQLServerClobBase extends SQLServerLob implements Serializable {
private final SQLCollation sqlCollation;
private boolean isClosed = false;
-
+
private final TypeInfo typeInfo;
// Active streams which must be closed when the Clob/NClob is closed
//
- // Initial size of the array is based on an assumption that a Clob/NClob object is
- // typically used either for input or output, and then only once. The array size
+ // Initial size of the array is based on an assumption that a Clob/NClob
+ // object is
+ // typically used either for input or output, and then only once. The array
+ // size
// grows automatically if multiple streams are used.
private ArrayListPreparedStatement object that will generate ResultSet objects with the given type, concurrency, and
- * holdability.
- * prepareStatement method above, but it allows the default result set type, concurrency, and
- * holdability to be overridden.
- *
- * @param sql
- * a String object that is the SQL statement to be sent to the database; may contain one or more '?' IN parameters
- * @param nType
- * one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY,
- * ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
- * @param nConcur
- * one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or
- * ResultSet.CONCUR_UPDATABLE
- * @param resultSetHoldability
- * one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or
- * ResultSet.CLOSE_CURSORS_AT_COMMIT
- * @param stmtColEncSetting
- * Specifies how data will be sent and received when reading and writing encrypted columns.
- * @return a new PreparedStatement object, containing the pre-compiled SQL statement, that will generate ResultSet
- * objects with the given type, concurrency, and holdability
- * @throws SQLServerException
- * if a database access error occurs, this method is called on a closed connection or the given parameters are not
- * ResultSet constants indicating type, concurrency, and holdability
- */
+ @Override
public PreparedStatement prepareStatement(java.lang.String sql,
int nType,
int nConcur,
int resultSetHoldability,
SQLServerStatementColumnEncryptionSetting stmtColEncSetting) throws SQLServerException {
- loggerExternal.entering(getClassNameLogging(), "prepareStatement",
- new Object[] {nType, nConcur, resultSetHoldability, stmtColEncSetting});
+ loggerExternal.entering(getClassNameLogging(), "prepareStatement", new Object[] {nType, nConcur, resultSetHoldability, stmtColEncSetting});
checkClosed();
checkValidHoldability(resultSetHoldability);
checkMatchesCurrentHoldability(resultSetHoldability);
- PreparedStatement st;
+ PreparedStatement st = new SQLServerPreparedStatement(this, sql, nType, nConcur, stmtColEncSetting);
- // Make sure SQLServerPreparedStatement42 is used for 4.2 and above.
- if (Util.use42Wrapper() || Util.use43Wrapper()) {
- st = new SQLServerPreparedStatement42(this, sql, nType, nConcur, stmtColEncSetting);
- }
- else {
- st = new SQLServerPreparedStatement(this, sql, nType, nConcur, stmtColEncSetting);
+ if (requestStarted) {
+ addOpenStatement(st);
}
loggerExternal.exiting(getClassNameLogging(), "prepareStatement", st);
return st;
}
- /* L3 */ public CallableStatement prepareCall(String sql,
+ @Override
+ public CallableStatement prepareCall(String sql,
int nType,
int nConcur,
int resultSetHoldability) throws SQLServerException {
- loggerExternal.entering(getClassNameLogging(), "prepareStatement",
- new Object[] {nType, nConcur, resultSetHoldability});
+ loggerExternal.entering(getClassNameLogging(), "prepareStatement", new Object[] {nType, nConcur, resultSetHoldability});
CallableStatement st = prepareCall(sql, nType, nConcur, resultSetHoldability, SQLServerStatementColumnEncryptionSetting.UseConnectionSetting);
loggerExternal.exiting(getClassNameLogging(), "prepareCall", st);
return st;
}
+ @Override
public CallableStatement prepareCall(String sql,
int nType,
int nConcur,
int resultSetHoldability,
SQLServerStatementColumnEncryptionSetting stmtColEncSetiing) throws SQLServerException {
- loggerExternal.entering(getClassNameLogging(), "prepareStatement",
- new Object[] {nType, nConcur, resultSetHoldability, stmtColEncSetiing});
+ loggerExternal.entering(getClassNameLogging(), "prepareStatement", new Object[] {nType, nConcur, resultSetHoldability, stmtColEncSetiing});
checkClosed();
checkValidHoldability(resultSetHoldability);
checkMatchesCurrentHoldability(resultSetHoldability);
- CallableStatement st;
+ CallableStatement st = new SQLServerCallableStatement(this, sql, nType, nConcur, stmtColEncSetiing);
- // Make sure SQLServerCallableStatement42 is used for 4.2 and above
- if (Util.use42Wrapper() || Util.use43Wrapper()) {
- st = new SQLServerCallableStatement42(this, sql, nType, nConcur, stmtColEncSetiing);
- }
- else {
- st = new SQLServerCallableStatement(this, sql, nType, nConcur, stmtColEncSetiing);
+ if (requestStarted) {
+ addOpenStatement(st);
}
loggerExternal.exiting(getClassNameLogging(), "prepareCall", st);
@@ -4751,7 +4792,8 @@ public CallableStatement prepareCall(String sql,
/* JDBC 3.0 Auto generated keys */
- /* L3 */ public PreparedStatement prepareStatement(String sql,
+ @Override
+ public PreparedStatement prepareStatement(String sql,
int flag) throws SQLServerException {
loggerExternal.entering(getClassNameLogging(), "prepareStatement", new Object[] {sql, flag});
@@ -4762,33 +4804,7 @@ public CallableStatement prepareCall(String sql,
return ps;
}
- /**
- * Creates a default PreparedStatement object that has the capability to retrieve auto-generated keys. The given constant tells the
- * driver whether it should make auto-generated keys available for retrieval. This parameter is ignored if the SQL statement is not an
- * INSERT statement, or an SQL statement able to return auto-generated keys (the list of such statements is vendor-specific).
- * prepareStatement will send the statement to the database for precompilation. Some drivers may not
- * support precompilation. In this case, the statement may not be sent to the database until the PreparedStatement object is
- * executed. This has no direct effect on users; however, it does affect which methods throw certain SQLExceptions.
- * PreparedStatement object will by default be type TYPE_FORWARD_ONLY and have a
- * concurrency level of CONCUR_READ_ONLY. The holdability of the created result sets can be determined by calling
- * {@link #getHoldability}.
- *
- * @param sql
- * an SQL statement that may contain one or more '?' IN parameter placeholders
- * @param flag
- * a flag indicating whether auto-generated keys should be returned; one of Statement.RETURN_GENERATED_KEYS or
- * Statement.NO_GENERATED_KEYS
- * @param stmtColEncSetting
- * Specifies how data will be sent and received when reading and writing encrypted columns.
- * @return a new PreparedStatement object, containing the pre-compiled SQL statement, that will have the capability of returning
- * auto-generated keys
- * @throws SQLServerException
- * if a database access error occurs, this method is called on a closed connection or the given parameter is not a
- * Statement constant indicating whether auto-generated keys should be returned
- */
+ @Override
public PreparedStatement prepareStatement(String sql,
int flag,
SQLServerStatementColumnEncryptionSetting stmtColEncSetting) throws SQLServerException {
@@ -4801,7 +4817,8 @@ public PreparedStatement prepareStatement(String sql,
return ps;
}
- /* L3 */ public PreparedStatement prepareStatement(String sql,
+ @Override
+ public PreparedStatement prepareStatement(String sql,
int[] columnIndexes) throws SQLServerException {
loggerExternal.entering(getClassNameLogging(), "prepareStatement", new Object[] {sql, columnIndexes});
SQLServerPreparedStatement ps = (SQLServerPreparedStatement) prepareStatement(sql, columnIndexes,
@@ -4811,35 +4828,7 @@ public PreparedStatement prepareStatement(String sql,
return ps;
}
- /**
- * Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array. This array
- * contains the indexes of the columns in the target table that contain the auto-generated keys that should be made available. The driver will
- * ignore the array if the SQL statement is not an INSERT statement, or an SQL statement able to return auto-generated keys (the list
- * of such statements is vendor-specific).
- * PreparedStatement object. This object can then
- * be used to efficiently execute this statement multiple times.
- * prepareStatement will send the statement to the database for precompilation. Some drivers may not
- * support precompilation. In this case, the statement may not be sent to the database until the PreparedStatement object is
- * executed. This has no direct effect on users; however, it does affect which methods throw certain SQLExceptions.
- * PreparedStatement object will by default be type TYPE_FORWARD_ONLY and have a
- * concurrency level of CONCUR_READ_ONLY. The holdability of the created result sets can be determined by calling
- * {@link #getHoldability}.
- *
- * @param sql
- * an SQL statement that may contain one or more '?' IN parameter placeholders
- * @param columnIndexes
- * an array of column indexes indicating the columns that should be returned from the inserted row or rows
- * @param stmtColEncSetting
- * Specifies how data will be sent and received when reading and writing encrypted columns.
- * @return a new PreparedStatement object, containing the pre-compiled statement, that is capable of returning the auto-generated
- * keys designated by the given array of column indexes
- * @throws SQLServerException
- * if a database access error occurs or this method is called on a closed connection
- */
+ @Override
public PreparedStatement prepareStatement(String sql,
int[] columnIndexes,
SQLServerStatementColumnEncryptionSetting stmtColEncSetting) throws SQLServerException {
@@ -4856,7 +4845,8 @@ public PreparedStatement prepareStatement(String sql,
return ps;
}
- /* L3 */ public PreparedStatement prepareStatement(String sql,
+ @Override
+ public PreparedStatement prepareStatement(String sql,
String[] columnNames) throws SQLServerException {
loggerExternal.entering(getClassNameLogging(), "prepareStatement", new Object[] {sql, columnNames});
@@ -4867,35 +4857,7 @@ public PreparedStatement prepareStatement(String sql,
return ps;
}
- /**
- * Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array. This array
- * contains the names of the columns in the target table that contain the auto-generated keys that should be returned. The driver will ignore the
- * array if the SQL statement is not an INSERT statement, or an SQL statement able to return auto-generated keys (the list of such
- * statements is vendor-specific).
- * PreparedStatement object. This object can then
- * be used to efficiently execute this statement multiple times.
- * prepareStatement will send the statement to the database for precompilation. Some drivers may not
- * support precompilation. In this case, the statement may not be sent to the database until the PreparedStatement object is
- * executed. This has no direct effect on users; however, it does affect which methods throw certain SQLExceptions.
- * PreparedStatement object will by default be type TYPE_FORWARD_ONLY and have a
- * concurrency level of CONCUR_READ_ONLY. The holdability of the created result sets can be determined by calling
- * {@link #getHoldability}.
- *
- * @param sql
- * an SQL statement that may contain one or more '?' IN parameter placeholders
- * @param columnNames
- * an array of column names indicating the columns that should be returned from the inserted row or rows
- * @param stmtColEncSetting
- * Specifies how data will be sent and received when reading and writing encrypted columns.
- * @return a new PreparedStatement object, containing the pre-compiled statement, that is capable of returning the auto-generated
- * keys designated by the given array of column names
- * @throws SQLServerException
- * if a database access error occurs or this method is called on a closed connection
- */
+ @Override
public PreparedStatement prepareStatement(String sql,
String[] columnNames,
SQLServerStatementColumnEncryptionSetting stmtColEncSetting) throws SQLServerException {
@@ -4913,9 +4875,10 @@ public PreparedStatement prepareStatement(String sql,
/* JDBC 3.0 Savepoints */
- public void releaseSavepoint(Savepoint savepoint) throws SQLServerException {
+ @Override
+ public void releaseSavepoint(Savepoint savepoint) throws SQLException {
loggerExternal.entering(getClassNameLogging(), "releaseSavepoint", savepoint);
- NotImplemented();
+ SQLServerException.throwNotSupportedException(this, null);
}
final private Savepoint setNamedSavepoint(String sName) throws SQLServerException {
@@ -4938,7 +4901,8 @@ final private Savepoint setNamedSavepoint(String sName) throws SQLServerExceptio
return s;
}
- /* L3 */ public Savepoint setSavepoint(String sName) throws SQLServerException {
+ @Override
+ public Savepoint setSavepoint(String sName) throws SQLServerException {
loggerExternal.entering(getClassNameLogging(), "setSavepoint", sName);
if (loggerExternal.isLoggable(Level.FINER) && Util.IsActivityTraceOn()) {
loggerExternal.finer(toString() + " ActivityId: " + ActivityCorrelator.getNext().toString());
@@ -4949,7 +4913,8 @@ final private Savepoint setNamedSavepoint(String sName) throws SQLServerExceptio
return pt;
}
- /* L3 */ public Savepoint setSavepoint() throws SQLServerException {
+ @Override
+ public Savepoint setSavepoint() throws SQLServerException {
loggerExternal.entering(getClassNameLogging(), "setSavepoint");
if (loggerExternal.isLoggable(Level.FINER) && Util.IsActivityTraceOn()) {
loggerExternal.finer(toString() + " ActivityId: " + ActivityCorrelator.getNext().toString());
@@ -4960,7 +4925,8 @@ final private Savepoint setNamedSavepoint(String sName) throws SQLServerExceptio
return pt;
}
- /* L3 */ public void rollback(Savepoint s) throws SQLServerException {
+ @Override
+ public void rollback(Savepoint s) throws SQLServerException {
loggerExternal.entering(getClassNameLogging(), "rollback", s);
if (loggerExternal.isLoggable(Level.FINER) && Util.IsActivityTraceOn()) {
loggerExternal.finer(toString() + " ActivityId: " + ActivityCorrelator.getNext().toString());
@@ -4973,13 +4939,15 @@ final private Savepoint setNamedSavepoint(String sName) throws SQLServerExceptio
loggerExternal.exiting(getClassNameLogging(), "rollback");
}
- /* L3 */ public int getHoldability() throws SQLServerException {
+ @Override
+ public int getHoldability() throws SQLServerException {
loggerExternal.entering(getClassNameLogging(), "getHoldability");
if (loggerExternal.isLoggable(Level.FINER))
loggerExternal.exiting(getClassNameLogging(), "getHoldability", holdability);
return holdability;
}
+ @Override
public void setHoldability(int holdability) throws SQLServerException {
loggerExternal.entering(getClassNameLogging(), "setHoldability", holdability);
@@ -5002,6 +4970,7 @@ public void setHoldability(int holdability) throws SQLServerException {
loggerExternal.exiting(getClassNameLogging(), "setHoldability");
}
+ @Override
public int getNetworkTimeout() throws SQLException {
loggerExternal.entering(getClassNameLogging(), "getNetworkTimeout");
@@ -5019,6 +4988,7 @@ public int getNetworkTimeout() throws SQLException {
return timeout;
}
+ @Override
public void setNetworkTimeout(Executor executor,
int timeout) throws SQLException {
loggerExternal.entering(getClassNameLogging(), "setNetworkTimeout", timeout);
@@ -5030,7 +5000,7 @@ public void setNetworkTimeout(Executor executor,
}
checkClosed();
-
+
// check for setNetworkTimeout permission
SecurityManager secMgr = System.getSecurityManager();
if (secMgr != null) {
@@ -5055,6 +5025,7 @@ public void setNetworkTimeout(Executor executor,
loggerExternal.exiting(getClassNameLogging(), "setNetworkTimeout");
}
+ @Override
public String getSchema() throws SQLException {
loggerExternal.entering(getClassNameLogging(), "getSchema");
@@ -5094,6 +5065,7 @@ public String getSchema() throws SQLException {
return null;
}
+ @Override
public void setSchema(String schema) throws SQLException {
loggerExternal.entering(getClassNameLogging(), "setSchema", schema);
checkClosed();
@@ -5102,61 +5074,58 @@ public void setSchema(String schema) throws SQLException {
loggerExternal.exiting(getClassNameLogging(), "setSchema");
}
- /**
- * Modifies the setting of the sendTimeAsDatetime connection property. When true, java.sql.Time values will be sent to the server as SQL
- * Serverdatetime values. When false, java.sql.Time values will be sent to the server as SQL Servertime values. sendTimeAsDatetime can also be
- * modified programmatically with SQLServerDataSource.setSendTimeAsDatetime. The default value for this property may change in a future release.
- *
- * @param sendTimeAsDateTimeValue
- * enables/disables setting the sendTimeAsDatetime connection property. For more information about how the Microsoft JDBC Driver for
- * SQL Server configures java.sql.Time values before sending them to the server, see
- * Configuring How java.sql.Time Values are Sent to the
- * Server.
- */
- public synchronized void setSendTimeAsDatetime(boolean sendTimeAsDateTimeValue) {
+ @Override
+ public void setSendTimeAsDatetime(boolean sendTimeAsDateTimeValue) {
sendTimeAsDatetime = sendTimeAsDateTimeValue;
}
+ @Override
public java.sql.Array createArrayOf(String typeName,
Object[] elements) throws SQLException {
- // Not implemented
- throw new SQLFeatureNotSupportedException(SQLServerException.getErrString("R_notSupported"));
+ SQLServerException.throwNotSupportedException(this, null);
+ return null;
}
- public Blob createBlob() throws SQLException {
+ @Override
+ public java.sql.Blob createBlob() throws SQLException {
checkClosed();
return new SQLServerBlob(this);
}
- public Clob createClob() throws SQLException {
+ @Override
+ public java.sql.Clob createClob() throws SQLException {
checkClosed();
return new SQLServerClob(this);
}
- public NClob createNClob() throws SQLException {
+ @Override
+ public java.sql.NClob createNClob() throws SQLException {
checkClosed();
return new SQLServerNClob(this);
}
+ @Override
public SQLXML createSQLXML() throws SQLException {
loggerExternal.entering(getClassNameLogging(), "createSQLXML");
- SQLXML sqlxml = new SQLServerSQLXML(this);
+ SQLXML sqlxml = new SQLServerSQLXML(this);
if (loggerExternal.isLoggable(Level.FINER))
loggerExternal.exiting(getClassNameLogging(), "createSQLXML", sqlxml);
return sqlxml;
}
- public Struct createStruct(String typeName,
+ @Override
+ public java.sql.Struct createStruct(String typeName,
Object[] attributes) throws SQLException {
- // Not implemented
- throw new SQLFeatureNotSupportedException(SQLServerException.getErrString("R_notSupported"));
+ SQLServerException.throwNotSupportedException(this, null);
+ return null;
}
String getTrustedServerNameAE() throws SQLServerException {
return trustedServerNameAE.toUpperCase();
}
+ @Override
public Properties getClientInfo() throws SQLException {
loggerExternal.entering(getClassNameLogging(), "getClientInfo");
checkClosed();
@@ -5165,6 +5134,7 @@ public Properties getClientInfo() throws SQLException {
return p;
}
+ @Override
public String getClientInfo(String name) throws SQLException {
loggerExternal.entering(getClassNameLogging(), "getClientInfo", name);
checkClosed();
@@ -5172,6 +5142,7 @@ public String getClientInfo(String name) throws SQLException {
return null;
}
+ @Override
public void setClientInfo(Properties properties) throws SQLClientInfoException {
loggerExternal.entering(getClassNameLogging(), "setClientInfo", properties);
// This function is only marked as throwing only SQLClientInfoException so the conversion is necessary
@@ -5195,6 +5166,7 @@ public void setClientInfo(Properties properties) throws SQLClientInfoException {
loggerExternal.exiting(getClassNameLogging(), "setClientInfo");
}
+ @Override
public void setClientInfo(String name,
String value) throws SQLClientInfoException {
loggerExternal.entering(getClassNameLogging(), "setClientInfo", new Object[] {name, value});
@@ -5231,6 +5203,7 @@ public void setClientInfo(String name,
* @throws SQLException
* if the value supplied for the timeout is less than 0.
*/
+ @Override
public boolean isValid(int timeout) throws SQLException {
boolean isValid = false;
@@ -5274,6 +5247,7 @@ public boolean isValid(int timeout) throws SQLException {
return isValid;
}
+ @Override
public boolean isWrapperFor(Class> iface) throws SQLException {
loggerExternal.entering(getClassNameLogging(), "isWrapperFor", iface);
boolean f = iface.isInstance(this);
@@ -5281,6 +5255,7 @@ public boolean isWrapperFor(Class> iface) throws SQLException {
return f;
}
+ @Override
public