java.lang.AutoCloseable
, java.sql.CallableStatement
, ISQLServerPreparedStatement
, ISQLServerStatement
, java.sql.PreparedStatement
, java.sql.Statement
, java.sql.Wrapper
SQLServerCallableStatement
public interface ISQLServerCallableStatement extends java.sql.CallableStatement, ISQLServerPreparedStatement
SQLServerCallableStatement
class.Modifier and Type | Method | Description |
---|---|---|
java.io.InputStream |
getAsciiStream(int parameterIndex) |
Returns the value of the designated column in the current row of this
ResultSet object as a stream
of ASCII characters. |
java.io.InputStream |
getAsciiStream(java.lang.String parameterName) |
Returns the value of the designated column in the current row of this
ResultSet object as a stream
of ASCII characters. |
java.math.BigDecimal |
getBigDecimal(java.lang.String parameterName,
int scale) |
Deprecated.
|
java.io.InputStream |
getBinaryStream(int parameterIndex) |
Returns the value of the designated column in the current row of this
ResultSet object as a stream
of uninterpreted bytes. |
java.io.InputStream |
getBinaryStream(java.lang.String parameterName) |
Returns the value of the designated column in the current row of this
ResultSet object as a stream
of uninterpreted byte s. |
java.sql.Timestamp |
getDateTime(int index) |
Returns 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.
|
java.sql.Timestamp |
getDateTime(int index,
java.util.Calendar cal) |
Returns 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.
|
java.sql.Timestamp |
getDateTime(java.lang.String parameterName) |
Returns 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.
|
java.sql.Timestamp |
getDateTime(java.lang.String name,
java.util.Calendar cal) |
Returns 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.
|
DateTimeOffset |
getDateTimeOffset(int parameterIndex) |
Returns the DateTimeOffset value of parameter with index parameterIndex.
|
DateTimeOffset |
getDateTimeOffset(java.lang.String parameterName) |
Returns the DateTimeOffset value of parameter with name parameterName.
|
java.math.BigDecimal |
getMoney(int parameterIndex) |
Returns the value of the column specified as a java.math.BigDecimal object.
|
java.math.BigDecimal |
getMoney(java.lang.String parameterName) |
Returns the value of the column specified as a java.math.BigDecimal object.
|
java.sql.Timestamp |
getSmallDateTime(int index) |
Returns 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.
|
java.sql.Timestamp |
getSmallDateTime(int index,
java.util.Calendar cal) |
Returns 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.
|
java.sql.Timestamp |
getSmallDateTime(java.lang.String parameterName) |
Returns 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.
|
java.sql.Timestamp |
getSmallDateTime(java.lang.String name,
java.util.Calendar cal) |
Returns 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.
|
java.math.BigDecimal |
getSmallMoney(int parameterIndex) |
Returns the value of the column specified as a java.math.BigDecimal object.
|
java.math.BigDecimal |
getSmallMoney(java.lang.String parameterName) |
Returns the value of the column specified as a java.math.BigDecimal object.
|
void |
registerOutParameter(int parameterIndex,
int sqlType,
int precision,
int scale) |
Registers the parameter in ordinal position index to be of JDBC type sqlType.
|
void |
registerOutParameter(int parameterIndex,
java.sql.SQLType sqlType,
int precision,
int scale) |
Registers the parameter in ordinal position index to be of JDBC type sqlType.
|
void |
registerOutParameter(java.lang.String parameterName,
int sqlType,
int precision,
int scale) |
Registers the parameter in ordinal position index to be of JDBC type sqlType.
|
void |
registerOutParameter(java.lang.String parameterName,
java.sql.SQLType sqlType,
int precision,
int scale) |
Registers the parameter in ordinal position index to be of JDBC type sqlType.
|
void |
setBigDecimal(java.lang.String parameterName,
java.math.BigDecimal value,
int precision,
int scale) |
Sets the designated parameter to the given
java.math.BigDecimal value. |
void |
setBigDecimal(java.lang.String parameterName,
java.math.BigDecimal value,
int precision,
int scale,
boolean forceEncrypt) |
Sets the designated parameter to the given
java.math.BigDecimal value. |
void |
setBoolean(java.lang.String parameterName,
boolean value,
boolean forceEncrypt) |
Sets the designated parameter to the given Java
boolean value. |
void |
setByte(java.lang.String parameterName,
byte value,
boolean forceEncrypt) |
Sets the designated parameter to the given Java
byte value. |
void |
setBytes(java.lang.String parameterName,
byte[] value,
boolean forceEncrypt) |
Sets the designated parameter to the given Java array of bytes.
|
void |
setDate(java.lang.String parameterName,
java.sql.Date value,
java.util.Calendar calendar,
boolean forceEncrypt) |
Sets the designated parameter to the given
java.sql.Date value, using the given
Calendar object. |
void |
setDateTime(java.lang.String parameterName,
java.sql.Timestamp value) |
Sets the designated parameter to the given
java.sql.Timestamp value. |
void |
setDateTime(java.lang.String parameterName,
java.sql.Timestamp value,
boolean forceEncrypt) |
Sets the designated parameter to the given
java.sql.Timestamp value. |
void |
setDateTimeOffset(java.lang.String parameterName,
DateTimeOffset value) |
Sets parameter parameterName to DateTimeOffset value.
|
void |
setDateTimeOffset(java.lang.String parameterName,
DateTimeOffset value,
int scale) |
Sets parameter parameterName to DateTimeOffset value.
|
void |
setDateTimeOffset(java.lang.String parameterName,
DateTimeOffset value,
int scale,
boolean forceEncrypt) |
Sets parameter parameterName to DateTimeOffset value.
|
void |
setDouble(java.lang.String parameterName,
double value,
boolean forceEncrypt) |
Sets the designated parameter to the given Java
double value. |
void |
setFloat(java.lang.String parameterName,
float value,
boolean forceEncrypt) |
Sets the designated parameter to the given Java
float value. |
void |
setInt(java.lang.String parameterName,
int value,
boolean forceEncrypt) |
Sets the designated parameter to the given Java
int value. |
void |
setLong(java.lang.String parameterName,
long value,
boolean forceEncrypt) |
Sets the designated parameter to the given Java
long value. |
void |
setMoney(java.lang.String parameterName,
java.math.BigDecimal value) |
Sets the designated parameter to the given Java
java.math.BigDecimal value. |
void |
setMoney(java.lang.String parameterName,
java.math.BigDecimal value,
boolean forceEncrypt) |
Sets the designated parameter to the given Java
java.math.BigDecimal value. |
void |
setNString(java.lang.String parameterName,
java.lang.String value,
boolean forceEncrypt) |
Sets the designated parameter to the given
String object. |
void |
setObject(java.lang.String parameterName,
java.lang.Object value,
int sqlType,
int decimals,
boolean forceEncrypt) |
Sets the value of the designated parameter with the given object.
|
void |
setObject(java.lang.String parameterName,
java.lang.Object value,
int targetSqlType,
java.lang.Integer precision,
int scale) |
Sets the value of the designated parameter with the given object.
|
void |
setObject(java.lang.String parameterName,
java.lang.Object value,
java.sql.SQLType jdbcType,
int scale,
boolean forceEncrypt) |
Sets the value of the designated parameter with the given object.
|
void |
setShort(java.lang.String parameterName,
short value,
boolean forceEncrypt) |
Sets the designated parameter to the given Java
short value. |
void |
setSmallDateTime(java.lang.String parameterName,
java.sql.Timestamp value) |
Sets the designated parameter to the given
java.sql.Timestamp value. |
void |
setSmallDateTime(java.lang.String parameterName,
java.sql.Timestamp value,
boolean forceEncrypt) |
Sets the designated parameter to the given
java.sql.Timestamp value. |
void |
setSmallMoney(java.lang.String parameterName,
java.math.BigDecimal value) |
Sets the designated parameter to the given Java
java.math.BigDecimal value. |
void |
setSmallMoney(java.lang.String parameterName,
java.math.BigDecimal value,
boolean forceEncrypt) |
Sets the designated parameter to the given Java
java.math.BigDecimal value. |
void |
setString(java.lang.String parameterName,
java.lang.String value,
boolean forceEncrypt) |
Sets the designated parameter to the given Java
String value. |
void |
setStructured(java.lang.String parameterName,
java.lang.String tvpName,
ISQLServerDataRecord tvpDataRecord) |
Populates a table valued parameter passed to a stored procedure with an ISQLServerDataRecord object.
|
void |
setStructured(java.lang.String parameterName,
java.lang.String tvpName,
SQLServerDataTable tvpDataTable) |
Populates a table valued parameter passed to a stored procedure with a data table.
|
void |
setStructured(java.lang.String parameterName,
java.lang.String tvpName,
java.sql.ResultSet tvpResultSet) |
Populates a table valued parameter passed to a stored procedure with a ResultSet retrieved from another table
|
void |
setTime(java.lang.String parameterName,
java.sql.Time value,
int scale) |
Sets the designated parameter to the given
java.sql.Time value. |
void |
setTime(java.lang.String parameterName,
java.sql.Time value,
int scale,
boolean forceEncrypt) |
Sets the designated parameter to the given
java.sql.Time value. |
void |
setTime(java.lang.String parameterName,
java.sql.Time value,
java.util.Calendar calendar,
boolean forceEncrypt) |
Sets the designated parameter to the given
java.sql.Time value, using the given
Calendar object. |
void |
setTimestamp(java.lang.String parameterName,
java.sql.Timestamp value,
int scale) |
Sets the designated parameter to the given
java.sql.Timestamp value. |
void |
setTimestamp(java.lang.String parameterName,
java.sql.Timestamp value,
int scale,
boolean forceEncrypt) |
Sets the designated parameter to the given
java.sql.Timestamp value. |
void |
setTimestamp(java.lang.String parameterName,
java.sql.Timestamp value,
java.util.Calendar calendar,
boolean forceEncrypt) |
Sets the designated parameter to the given
java.sql.Timestamp value. |
void |
setUniqueIdentifier(java.lang.String parameterName,
java.lang.String guid) |
Sets the designated parameter to the given
String value. |
void |
setUniqueIdentifier(java.lang.String parameterName,
java.lang.String guid,
boolean forceEncrypt) |
Sets the designated parameter to the given
String value. |
getArray, getArray, getBigDecimal, getBigDecimal, getBigDecimal, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getDate, getDate, getDate, getDate, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getObject, getObject, getRef, getRef, getRowId, getRowId, getShort, getShort, getSQLXML, getSQLXML, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getURL, getURL, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setNull, setObject, setObject, setObject, setObject, setObject, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setURL, wasNull
getParameterMetaData, getPreparedStatementHandle, setBigDecimal, setBigDecimal, setBoolean, setByte, setBytes, setDate, setDateTime, setDateTime, setDateTimeOffset, setDateTimeOffset, setDateTimeOffset, setDouble, setFloat, setGeography, setGeometry, setInt, setLong, setMoney, setMoney, setNString, setObject, setObject, setObject, setObject, setShort, setSmallDateTime, setSmallDateTime, setSmallMoney, setSmallMoney, setString, setStructured, setStructured, setStructured, setTime, setTime, setTime, setTimestamp, setTimestamp, setTimestamp, setUniqueIdentifier, setUniqueIdentifier
getCancelQueryTimeout, getResponseBuffering, setCancelQueryTimeout, setResponseBuffering
addBatch, clearParameters, execute, executeLargeUpdate, executeQuery, executeUpdate, getMetaData, getParameterMetaData, setArray, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setNull, setObject, setObject, setObject, setObject, setObject, setRef, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL
addBatch, cancel, clearBatch, clearWarnings, close, closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, execute, execute, execute, execute, executeBatch, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, isSimpleIdentifier, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
@Deprecated java.math.BigDecimal getBigDecimal(java.lang.String parameterName, int scale) throws SQLServerException
SQLServerException
java.sql.Timestamp getDateTime(int index) throws SQLServerException
index
- the first column is 1, the second is 2, ...SQLServerException
- when an error occursjava.sql.Timestamp getDateTime(java.lang.String parameterName) throws SQLServerException
parameterName
- 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 columnSQLServerException
- when an error occursjava.sql.Timestamp getDateTime(int index, java.util.Calendar cal) throws SQLServerException
index
- the first column is 1, the second is 2, ...cal
- the java.util.Calendar object to use in constructing the dateTimeSQLServerException
- when an error occursjava.sql.Timestamp getDateTime(java.lang.String name, java.util.Calendar cal) throws SQLServerException
name
- the name of the columncal
- the java.util.Calendar object to use in constructing the dateTimeSQLServerException
- when an error occursjava.sql.Timestamp getSmallDateTime(int index) throws SQLServerException
index
- the first column is 1, the second is 2, ...SQLServerException
- when an error occursjava.sql.Timestamp getSmallDateTime(java.lang.String parameterName) throws SQLServerException
parameterName
- The name of a column.SQLServerException
- when an error occursjava.sql.Timestamp getSmallDateTime(int index, java.util.Calendar cal) throws SQLServerException
index
- the first column is 1, the second is 2, ...cal
- the java.util.Calendar object to use in constructing the smalldateTimeSQLServerException
- when an error occursjava.sql.Timestamp getSmallDateTime(java.lang.String name, java.util.Calendar cal) throws SQLServerException
name
- The name of a columncal
- the java.util.Calendar object to use in constructing the smalldateTimeSQLServerException
- when an error occursDateTimeOffset getDateTimeOffset(int parameterIndex) throws SQLServerException
parameterIndex
- the first parameter is 1, the second is 2, and so onSQLServerException
- if parameterIndex is out of range; if a database access error occurs or this method is called on a closed
CallableStatement
DateTimeOffset getDateTimeOffset(java.lang.String parameterName) throws SQLServerException
parameterName
- the name of the parameterSQLServerException
- if parameterName does not correspond to a named parameter; if a database access error occurs or this
method is called on a closed CallableStatement
java.io.InputStream getAsciiStream(int parameterIndex) throws SQLServerException
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.
parameterIndex
- the first column is 1, the second is 2, ...NULL
, the value returned is null
SQLServerException
- if the columnIndex is not valid; if a database access error occurs or this method is called on a closed
result setjava.io.InputStream getAsciiStream(java.lang.String parameterName) throws SQLServerException
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.
parameterName
- the name of the parameterNULL
, the value returned is null
.SQLServerException
- if the columnLabel is not valid; if a database access error occurs or this method is called on a closed
result setjava.math.BigDecimal getMoney(int parameterIndex) throws SQLServerException
parameterIndex
- The zero-based ordinal of a column.SQLServerException
- when an error occursjava.math.BigDecimal getMoney(java.lang.String parameterName) throws SQLServerException
parameterName
- The name of a column.SQLServerException
- when an error occursjava.math.BigDecimal getSmallMoney(int parameterIndex) throws SQLServerException
parameterIndex
- The zero-based ordinal of a column.SQLServerException
- when an error occursjava.math.BigDecimal getSmallMoney(java.lang.String parameterName) throws SQLServerException
parameterName
- The name of a column.SQLServerException
- when an error occursjava.io.InputStream getBinaryStream(int parameterIndex) throws SQLServerException
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.
parameterIndex
- the first column is 1, the second is 2, ...NULL
, the value returned is null
SQLServerException
- if the columnIndex is not valid; if a database access error occurs or this method is called on a closed
result setjava.io.InputStream getBinaryStream(java.lang.String parameterName) throws SQLServerException
ResultSet
object as a stream
of uninterpreted byte
s. 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.
parameterName
- the name of the parameterNULL
, the result is null
SQLServerException
- if the columnLabel is not valid; if a database access error occurs or this method is called on a closed
result setvoid setTimestamp(java.lang.String parameterName, java.sql.Timestamp value, java.util.Calendar calendar, boolean forceEncrypt) throws SQLServerException
java.sql.Timestamp
value. The driver converts this to an
SQL TIMESTAMP
value when it sends it to the database.parameterName
- the name of the parametervalue
- the parameter valuecalendar
- a java.util.CalendarforceEncrypt
- 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.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
CallableStatement.getTimestamp(int)
void setTime(java.lang.String parameterName, java.sql.Time value, java.util.Calendar calendar, boolean forceEncrypt) throws SQLServerException
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.parameterName
- the name of the parametervalue
- the parameter valuecalendar
- the Calendar
object the driver will use to construct the timeforceEncrypt
- 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.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
CallableStatement.getTime(int)
void setDate(java.lang.String parameterName, java.sql.Date value, java.util.Calendar calendar, boolean forceEncrypt) throws SQLServerException
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.parameterName
- the name of the parametervalue
- the parameter valuecalendar
- the Calendar
object the driver will use to construct the dateforceEncrypt
- If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column
is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean
forceEncrypt is set to false, the driver will not force encryption on parameters.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
CallableStatement.getDate(int)
void setNString(java.lang.String parameterName, java.lang.String value, boolean forceEncrypt) throws SQLServerException
String
object. The driver converts this to a SQL
NCHAR
or NVARCHAR
or LONGNVARCHAR
parameterName
- the name of the parameter to be setvalue
- the parameter valueforceEncrypt
- If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column
is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean
forceEncrypt is set to false, the driver will not force encryption on parameters.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
void setObject(java.lang.String parameterName, java.lang.Object value, int sqlType, int decimals, boolean forceEncrypt) throws SQLServerException
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.
parameterName
- the name of the parametervalue
- the object containing the input parameter valuesqlType
- the SQL type (as defined in java.sql.Types) to be sent to the database. The scale argument may further
qualify this type.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.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.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
Types
,
CallableStatement.getObject(int)
void setObject(java.lang.String parameterName, java.lang.Object value, int targetSqlType, java.lang.Integer precision, int scale) throws SQLServerException
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.
parameterName
- the name of the parametervalue
- the object containing the input parameter valuetargetSqlType
- the SQL type (as defined in java.sql.Types) to be sent to the database. The scale argument may further
qualify this type.precision
- the precision of the column.scale
- the scale of the column.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
Types
,
CallableStatement.getObject(int)
void setTimestamp(java.lang.String parameterName, java.sql.Timestamp value, int scale) throws SQLServerException
java.sql.Timestamp
value. The driver converts this to an
SQL TIMESTAMP
value when it sends it to the database.parameterName
- the name of the parametervalue
- the parameter valuescale
- the scale of the parameterSQLServerException
- if parameterName does not correspond to a named parameter; if a database access error occurs or this
method is called on a closed CallableStatement
CallableStatement.getTimestamp(int)
void setTimestamp(java.lang.String parameterName, java.sql.Timestamp value, int scale, boolean forceEncrypt) throws SQLServerException
java.sql.Timestamp
value. The driver converts this to an
SQL TIMESTAMP
value when it sends it to the database.parameterName
- the name of the parametervalue
- the parameter valuescale
- the scale of the parameterforceEncrypt
- 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.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
CallableStatement.getTimestamp(int)
void setDateTimeOffset(java.lang.String parameterName, DateTimeOffset value) throws SQLServerException
parameterName
- the name of the parametervalue
- DateTimeOffset valueSQLServerException
- if an error occursvoid setDateTimeOffset(java.lang.String parameterName, DateTimeOffset value, int scale) throws SQLServerException
parameterName
- the name of the parametervalue
- DateTimeOffset valuescale
- the scale of the parameterSQLServerException
- if an error occursvoid setDateTimeOffset(java.lang.String parameterName, DateTimeOffset value, int scale, boolean forceEncrypt) throws SQLServerException
parameterName
- the name of the parametervalue
- DateTimeOffset valuescale
- the scale of the parameterforceEncrypt
- 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.SQLServerException
- if an error occursvoid setTime(java.lang.String parameterName, java.sql.Time value, int scale) throws SQLServerException
java.sql.Time
value. The driver converts this to an SQL
TIME
value when it sends it to the database.parameterName
- the name of the parametervalue
- the parameter valuescale
- the scale of the columnSQLServerException
- if parameterName does not correspond to a named parameter; if a database access error occurs or this
method is called on a closed CallableStatement
CallableStatement.getTime(int)
void setTime(java.lang.String parameterName, java.sql.Time value, int scale, boolean forceEncrypt) throws SQLServerException
java.sql.Time
value. The driver converts this to an SQL
TIME
value when it sends it to the database.parameterName
- the name of the parametervalue
- the parameter valuescale
- the scale of the columnforceEncrypt
- If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column
is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean
forceEncrypt is set to false, the driver will not force encryption on parameters.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
CallableStatement.getTime(int)
void setDateTime(java.lang.String parameterName, java.sql.Timestamp value) throws SQLServerException
java.sql.Timestamp
value. The driver converts this to an
SQL DATETIME
value when it sends it to the database.parameterName
- the name of the parametervalue
- the parameter valueSQLServerException
- if parameterName does not correspond to a named parameter; if a database access error occurs or this
method is called on a closed CallableStatement
void setDateTime(java.lang.String parameterName, java.sql.Timestamp value, boolean forceEncrypt) throws SQLServerException
java.sql.Timestamp
value. The driver converts this to an
SQL DATETIME
value when it sends it to the database.parameterName
- the name of the parametervalue
- the parameter valueforceEncrypt
- If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column
is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean
forceEncrypt is set to false, the driver will not force encryption on parameters.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
void setSmallDateTime(java.lang.String parameterName, java.sql.Timestamp value) throws SQLServerException
java.sql.Timestamp
value. The driver converts this to an
SQL SMALLDATETIME
value when it sends it to the database.parameterName
- the name of the parametervalue
- the parameter valueSQLServerException
- if parameterName does not correspond to a named parameter; if a database access error occurs or this
method is called on a closed CallableStatement
void setSmallDateTime(java.lang.String parameterName, java.sql.Timestamp value, boolean forceEncrypt) throws SQLServerException
java.sql.Timestamp
value. The driver converts this to an
SQL SMALLDATETIME
value when it sends it to the database.parameterName
- the name of the parametervalue
- the parameter valueforceEncrypt
- If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column
is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean
forceEncrypt is set to false, the driver will not force encryption on parameters.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
void setUniqueIdentifier(java.lang.String parameterName, java.lang.String guid) throws SQLServerException
String
value. The driver converts this to an SQL
uniqueIdentifier
value when it sends it to the database.parameterName
- the name of the parameterguid
- the parameter valueSQLServerException
- if parameterName does not correspond to a named parameter; if a database access error occurs or this
method is called on a closed CallableStatement
void setUniqueIdentifier(java.lang.String parameterName, java.lang.String guid, boolean forceEncrypt) throws SQLServerException
String
value. The driver converts this to an SQL
uniqueIdentifier
value when it sends it to the database.parameterName
- the name of the parameterguid
- the parameter valueforceEncrypt
- If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column
is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean
forceEncrypt is set to false, the driver will not force encryption on parameters.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
void setBytes(java.lang.String parameterName, byte[] value, boolean forceEncrypt) throws SQLServerException
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.parameterName
- the name of the parametervalue
- the parameter valueforceEncrypt
- If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column
is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean
forceEncrypt is set to false, the driver will not force encryption on parameters.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
void setByte(java.lang.String parameterName, byte value, boolean forceEncrypt) throws SQLServerException
byte
value. The driver converts this to an SQL
TINYINT
value when it sends it to the database.parameterName
- the name of the parametervalue
- the parameter valueforceEncrypt
- If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column
is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean
forceEncrypt is set to false, the driver will not force encryption on parameters.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
void setString(java.lang.String parameterName, java.lang.String value, boolean forceEncrypt) throws SQLServerException
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.parameterName
- the name of the parametervalue
- the parameter valueforceEncrypt
- If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column
is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean
forceEncrypt is set to false, the driver will not force encryption on parameters.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
void setMoney(java.lang.String parameterName, java.math.BigDecimal value) throws SQLServerException
java.math.BigDecimal
value. The driver converts this
to an SQL Money
value.parameterName
- the name of the parametervalue
- the parameter valueSQLServerException
- if parameterName does not correspond to a named parameter; if a database access error occurs or this
method is called on a closed CallableStatement
void setMoney(java.lang.String parameterName, java.math.BigDecimal value, boolean forceEncrypt) throws SQLServerException
java.math.BigDecimal
value. The driver converts this
to an SQL Money
value.parameterName
- the name of the parametervalue
- the parameter valueforceEncrypt
- If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column
is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean
forceEncrypt is set to false, the driver will not force encryption on parameters.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
void setSmallMoney(java.lang.String parameterName, java.math.BigDecimal value) throws SQLServerException
java.math.BigDecimal
value. The driver converts this
to an SQL smallMoney
value.parameterName
- the name of the parametervalue
- the parameter valueSQLServerException
- if parameterName does not correspond to a named parameter; if a database access error occurs or this
method is called on a closed CallableStatement
void setSmallMoney(java.lang.String parameterName, java.math.BigDecimal value, boolean forceEncrypt) throws SQLServerException
java.math.BigDecimal
value. The driver converts this
to an SQL smallMoney
value.parameterName
- the name of the parametervalue
- the parameter valueforceEncrypt
- If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column
is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean
forceEncrypt is set to false, the driver will not force encryption on parameters.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
void setBigDecimal(java.lang.String parameterName, java.math.BigDecimal value, int precision, int scale) throws SQLServerException
java.math.BigDecimal
value. The driver converts this to
an SQL NUMERIC
value when it sends it to the database.parameterName
- the name of the parametervalue
- the parameter valueprecision
- the precision of the columnscale
- the scale of the columnSQLServerException
- if parameterName does not correspond to a named parameter; if a database access error occurs or this
method is called on a closed CallableStatement
void setBigDecimal(java.lang.String parameterName, java.math.BigDecimal value, int precision, int scale, boolean forceEncrypt) throws SQLServerException
java.math.BigDecimal
value. The driver converts this to
an SQL NUMERIC
value when it sends it to the database.parameterName
- the name of the parametervalue
- the parameter valueprecision
- the precision of the columnscale
- the scale of the columnforceEncrypt
- If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column
is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean
forceEncrypt is set to false, the driver will not force encryption on parameters.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
void setDouble(java.lang.String parameterName, double value, boolean forceEncrypt) throws SQLServerException
double
value. The driver converts this to an SQL
DOUBLE
value when it sends it to the database.parameterName
- the name of the parametervalue
- the parameter valueforceEncrypt
- If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column
is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean
forceEncrypt is set to false, the driver will not force encryption on parameters.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
void setFloat(java.lang.String parameterName, float value, boolean forceEncrypt) throws SQLServerException
float
value. The driver converts this to an SQL
FLOAT
value when it sends it to the database.parameterName
- the name of the parametervalue
- the parameter valueforceEncrypt
- If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column
is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean
forceEncrypt is set to false, the driver will not force encryption on parameters.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
void setInt(java.lang.String parameterName, int value, boolean forceEncrypt) throws SQLServerException
int
value. The driver converts this to an SQL
INTEGER
value when it sends it to the database.parameterName
- the name of the parametervalue
- the parameter valueforceEncrypt
- If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column
is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean
forceEncrypt is set to false, the driver will not force encryption on parameters.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
void setLong(java.lang.String parameterName, long value, boolean forceEncrypt) throws SQLServerException
long
value. The driver converts this to an SQL
BIGINT
value when it sends it to the database.parameterName
- the name of the parametervalue
- the parameter valueforceEncrypt
- If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column
is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean
forceEncrypt is set to false, the driver will not force encryption on parameters.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
void setShort(java.lang.String parameterName, short value, boolean forceEncrypt) throws SQLServerException
short
value. The driver converts this to an SQL
SMALLINT
value when it sends it to the database.parameterName
- the name of the parametervalue
- the parameter valueforceEncrypt
- If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column
is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean
forceEncrypt is set to false, the driver will not force encryption on parameters.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
void setBoolean(java.lang.String parameterName, boolean value, boolean forceEncrypt) throws SQLServerException
boolean
value. The driver converts this to an SQL
BIT
or BOOLEAN
value when it sends it to the database.parameterName
- the name of the parametervalue
- the parameter valueforceEncrypt
- If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column
is encrypted and Always Encrypted is enabled on the connection or on the statement. If the boolean
forceEncrypt is set to false, the driver will not force encryption on parameters.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
void setStructured(java.lang.String parameterName, java.lang.String tvpName, SQLServerDataTable tvpDataTable) throws SQLServerException
parameterName
- the name of the parametertvpName
- the name of the type TVPtvpDataTable
- the data table objectSQLServerException
- when an error occursvoid setStructured(java.lang.String parameterName, java.lang.String tvpName, java.sql.ResultSet tvpResultSet) throws SQLServerException
parameterName
- the name of the parametertvpName
- the name of the type TVPtvpResultSet
- the source result set objectSQLServerException
- when an error occursvoid setStructured(java.lang.String parameterName, java.lang.String tvpName, ISQLServerDataRecord tvpDataRecord) throws SQLServerException
parameterName
- the name of the parametertvpName
- the name of the type TVPtvpDataRecord
- ISQLServerDataRecord is used for streaming data and the user decides how to use it. tvpDataRecord is an
ISQLServerDataRecord object.the source result set objectSQLServerException
- when an error occursvoid registerOutParameter(java.lang.String parameterName, java.sql.SQLType sqlType, int precision, int scale) throws SQLServerException
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.
parameterName
- the name of the parametersqlType
- the JDBC type code defined by SQLType to use to register the OUT Parameter.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.scale
- the desired number of digits to the right of the decimal point. It must be greater than or equal to zero.SQLServerException
- If any errors occur.void registerOutParameter(int parameterIndex, java.sql.SQLType sqlType, int precision, int scale) throws SQLServerException
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.
parameterIndex
- the first column is 1, the second is 2, ...sqlType
- the JDBC type code defined by SQLType to use to register the OUT Parameter.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.scale
- the desired number of digits to the right of the decimal point. It must be greater than or equal to zero.SQLServerException
- If any errors occur.void registerOutParameter(int parameterIndex, int sqlType, int precision, int scale) throws SQLServerException
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.
parameterIndex
- the first column is 1, the second is 2, ...sqlType
- the JDBC type code defined by SQLType to use to register the OUT Parameter.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.scale
- the desired number of digits to the right of the decimal point. It must be greater than or equal to zero.SQLServerException
- If any errors occur.void registerOutParameter(java.lang.String parameterName, int sqlType, int precision, int scale) throws SQLServerException
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.
parameterName
- the name of the parametersqlType
- the JDBC type code defined by SQLType to use to register the OUT Parameter.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.scale
- the desired number of digits to the right of the decimal point. It must be greater than or equal to zero.SQLServerException
- If any errors occur.void setObject(java.lang.String parameterName, java.lang.Object value, java.sql.SQLType jdbcType, int scale, boolean forceEncrypt) throws SQLServerException
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.
parameterName
- the name of the parametervalue
- the object containing the input parameter valuejdbcType
- the SQL type (as defined in java.sql.Types) to be sent to the database. The scale argument may further
qualify this type.scale
- the scale of the column.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.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
Types
,
CallableStatement.getObject(int)
Copyright © 2018 Microsoft Corporation. All rights reserved.