ISQLServerConnection, java.io.Serializable, java.lang.AutoCloseable, java.sql.Connection, java.sql.WrapperSQLServerConnection43public class SQLServerConnection extends java.lang.Object implements ISQLServerConnection, java.io.Serializable
SQLServerConnection manages transaction control for all statements that were created from it. SQLServerConnection may participate in XA distributed transactions managed via an XAResource adapter.
SQLServerConnection instantiates a new TDSChannel object for use by itself and all statement objects that are created under this connection. SQLServerConnection is thread safe.
SQLServerConnection manages a pool of prepared statement handles. Prepared statements are prepared once and typically executed many times with different data values for their parameters. Prepared statements are also maintained across logical (pooled) connection closes.
SQLServerConnection is not thread safe, however multiple statements created from a single connection can be processing simultaneously in concurrent threads.
This class's public functions need to be kept identical to the SQLServerConnectionPoolProxy's.
The API javadoc for JDBC API methods that this class implements are not repeated here. Please see Sun's JDBC API interfaces javadoc for those details.
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLETRANSACTION_SNAPSHOT| Modifier and Type | Method | Description |
|---|---|---|
void |
abort(java.util.concurrent.Executor executor) |
|
protected void |
beginRequestInternal() |
|
void |
clearWarnings() |
|
void |
close() |
|
void |
closeUnreferencedPreparedStatementHandles() |
Forces the un-prepare requests for any outstanding discarded prepared statements to be executed.
|
void |
commit() |
|
java.sql.Array |
createArrayOf(java.lang.String typeName,
java.lang.Object[] elements) |
|
java.sql.Blob |
createBlob() |
|
java.sql.Clob |
createClob() |
|
java.sql.NClob |
createNClob() |
|
java.sql.SQLXML |
createSQLXML() |
|
java.sql.Statement |
createStatement() |
|
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency) |
|
java.sql.Statement |
createStatement(int nType,
int nConcur,
int resultSetHoldability) |
|
java.sql.Statement |
createStatement(int nType,
int nConcur,
int resultSetHoldability,
SQLServerStatementColumnEncryptionSetting stmtColEncSetting) |
Creates a
Statement object that will generate ResultSet objects with the given type, concurrency, and holdability. |
java.sql.Struct |
createStruct(java.lang.String typeName,
java.lang.Object[] attributes) |
|
protected void |
endRequestInternal() |
|
boolean |
getAutoCommit() |
|
java.lang.String |
getCatalog() |
|
java.util.UUID |
getClientConnectionId() |
Gets the connection ID of the most recent connection attempt, regardless of whether the attempt succeeded or failed.
|
java.util.Properties |
getClientInfo() |
|
java.lang.String |
getClientInfo(java.lang.String name) |
|
static java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getColumnEncryptionTrustedMasterKeyPaths() |
Retrieves the Trusted Master Key Paths.
|
boolean |
getDisableStatementPooling() |
Determine whether statement pooling is disabled.
|
int |
getDiscardedServerPreparedStatementCount() |
Returns the number of currently outstanding prepared statement un-prepare actions.
|
boolean |
getEnablePrepareOnFirstPreparedStatementCall() |
Returns the behavior for a specific connection instance.
|
int |
getHoldability() |
|
java.sql.DatabaseMetaData |
getMetaData() |
|
int |
getNetworkTimeout() |
|
java.lang.String |
getSchema() |
|
boolean |
getSendTimeAsDatetime() |
Checks the sendTimeAsDatetime property.
|
int |
getServerPreparedStatementDiscardThreshold() |
Returns the behavior for a specific connection instance.
|
int |
getStatementHandleCacheEntryCount() |
Returns the current number of pooled prepared statement handles.
|
int |
getStatementPoolingCacheSize() |
Returns the size of the prepared statement cache for this connection.
|
int |
getTransactionIsolation() |
|
java.util.Map<java.lang.String,java.lang.Class<?>> |
getTypeMap() |
|
boolean |
getUseBulkCopyForBatchInsert() |
Retrieves the useBulkCopyForBatchInsert value.
|
java.sql.SQLWarning |
getWarnings() |
|
boolean |
isClosed() |
|
boolean |
isReadOnly() |
|
boolean |
isStatementPoolingEnabled() |
Whether statement pooling is enabled or not for this connection.
|
boolean |
isValid(int timeout) |
Determine whether the connection is still valid.
|
boolean |
isWrapperFor(java.lang.Class<?> iface) |
|
java.lang.String |
nativeSQL(java.lang.String sql) |
|
java.sql.CallableStatement |
prepareCall(java.lang.String sql) |
|
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency) |
|
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int nType,
int nConcur,
int resultSetHoldability) |
|
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int nType,
int nConcur,
int resultSetHoldability,
SQLServerStatementColumnEncryptionSetting stmtColEncSetiing) |
Creates a
CallableStatement object that will generate ResultSet objects with the given type and concurrency. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql) |
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int flag) |
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int[] columnIndexes) |
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int[] columnIndexes,
SQLServerStatementColumnEncryptionSetting stmtColEncSetting) |
Creates a default
PreparedStatement object capable of returning the auto-generated keys designated by the given array. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency) |
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int nType,
int nConcur,
int resultSetHoldability) |
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int nType,
int nConcur,
int resultSetHoldability,
SQLServerStatementColumnEncryptionSetting stmtColEncSetting) |
Creates a
PreparedStatement object that will generate ResultSet objects with the given type, concurrency, and
holdability. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int flag,
SQLServerStatementColumnEncryptionSetting stmtColEncSetting) |
Creates a default
PreparedStatement object that has the capability to retrieve auto-generated keys. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
java.lang.String[] columnNames) |
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
java.lang.String[] columnNames,
SQLServerStatementColumnEncryptionSetting stmtColEncSetting) |
Creates a default
PreparedStatement object capable of returning the auto-generated keys designated by the given array. |
static void |
registerColumnEncryptionKeyStoreProviders(java.util.Map<java.lang.String,SQLServerColumnEncryptionKeyStoreProvider> clientKeyStoreProviders) |
Registers key store providers in the globalCustomColumnEncryptionKeyStoreProviders.
|
void |
releaseSavepoint(java.sql.Savepoint savepoint) |
|
static void |
removeColumnEncryptionTrustedMasterKeyPaths(java.lang.String server) |
Removes the trusted Master key Path from the columnEncryptionTrustedMasterKeyPaths.
|
void |
rollback() |
|
void |
rollback(java.sql.Savepoint s) |
|
void |
setAutoCommit(boolean newAutoCommitMode) |
|
void |
setCatalog(java.lang.String catalog) |
|
void |
setClientInfo(java.lang.String name,
java.lang.String value) |
|
void |
setClientInfo(java.util.Properties properties) |
|
static void |
setColumnEncryptionKeyCacheTtl(int columnEncryptionKeyCacheTTL,
java.util.concurrent.TimeUnit unit) |
Sets time-to-live for column encryption key entries in the column encryption key cache for the Always Encrypted feature.
|
static void |
setColumnEncryptionTrustedMasterKeyPaths(java.util.Map<java.lang.String,java.util.List<java.lang.String>> trustedKeyPaths) |
Sets Trusted Master Key Paths in the columnEncryptionTrustedMasterKeyPaths.
|
void |
setDisableStatementPooling(boolean value) |
Disable/enable statement pooling.
|
void |
setEnablePrepareOnFirstPreparedStatementCall(boolean value) |
Specifies the behavior for a specific connection instance.
|
void |
setHoldability(int holdability) |
|
void |
setNetworkTimeout(java.util.concurrent.Executor executor,
int timeout) |
|
void |
setReadOnly(boolean readOnly) |
|
java.sql.Savepoint |
setSavepoint() |
|
java.sql.Savepoint |
setSavepoint(java.lang.String sName) |
|
void |
setSchema(java.lang.String schema) |
|
void |
setSendTimeAsDatetime(boolean sendTimeAsDateTimeValue) |
Modifies the setting of the sendTimeAsDatetime connection property.
|
void |
setServerPreparedStatementDiscardThreshold(int value) |
Specifies the behavior for a specific connection instance.
|
void |
setStatementPoolingCacheSize(int value) |
Specifies the size of the prepared statement cache for this connection.
|
void |
setTransactionIsolation(int level) |
|
void |
setTypeMap(java.util.Map<java.lang.String,java.lang.Class<?>> map) |
|
void |
setUseBulkCopyForBatchInsert(boolean useBulkCopyForBatchInsert) |
Specifies the flag for using Bulk Copy API for batch insert operations.
|
java.lang.String |
toString() |
This is a helper function to provide an ID string suitable for tracing.
|
<T> T |
unwrap(java.lang.Class<T> iface) |
|
static void |
updateColumnEncryptionTrustedMasterKeyPaths(java.lang.String server,
java.util.List<java.lang.String> trustedKeyPaths) |
Updates the columnEncryptionTrustedMasterKeyPaths with the new Server and trustedKeyPaths.
|
public boolean getUseBulkCopyForBatchInsert()
public void setUseBulkCopyForBatchInsert(boolean useBulkCopyForBatchInsert)
useBulkCopyForBatchInsert - boolean value for useBulkCopyForBatchInsert.public final boolean getSendTimeAsDatetime()
ISQLServerConnectiongetSendTimeAsDatetime in interface ISQLServerConnectionpublic static void registerColumnEncryptionKeyStoreProviders(java.util.Map<java.lang.String,SQLServerColumnEncryptionKeyStoreProvider> clientKeyStoreProviders) throws SQLServerException
clientKeyStoreProviders - a map containing the store providers information.SQLServerException - when an error occurspublic static void setColumnEncryptionTrustedMasterKeyPaths(java.util.Map<java.lang.String,java.util.List<java.lang.String>> trustedKeyPaths)
trustedKeyPaths - all master key paths that are trustedpublic static void updateColumnEncryptionTrustedMasterKeyPaths(java.lang.String server,
java.util.List<java.lang.String> trustedKeyPaths)
server - String server nametrustedKeyPaths - all master key paths that are trustedpublic static void removeColumnEncryptionTrustedMasterKeyPaths(java.lang.String server)
server - String server namepublic static java.util.Map<java.lang.String,java.util.List<java.lang.String>> getColumnEncryptionTrustedMasterKeyPaths()
public java.util.UUID getClientConnectionId()
throws SQLServerException
ISQLServerConnectiongetClientConnectionId in interface ISQLServerConnectionSQLServerException - If any errors occur.public java.lang.String toString()
toString in class java.lang.Objectpublic java.sql.Statement createStatement()
throws SQLServerException
createStatement in interface java.sql.ConnectionSQLServerExceptionpublic java.sql.PreparedStatement prepareStatement(java.lang.String sql)
throws SQLServerException
prepareStatement in interface java.sql.ConnectionSQLServerExceptionpublic java.sql.CallableStatement prepareCall(java.lang.String sql)
throws SQLServerException
prepareCall in interface java.sql.ConnectionSQLServerExceptionpublic java.lang.String nativeSQL(java.lang.String sql)
throws SQLServerException
nativeSQL in interface java.sql.ConnectionSQLServerExceptionpublic void setAutoCommit(boolean newAutoCommitMode)
throws SQLServerException
setAutoCommit in interface java.sql.ConnectionSQLServerExceptionpublic boolean getAutoCommit()
throws SQLServerException
getAutoCommit in interface java.sql.ConnectionSQLServerExceptionpublic void commit()
throws SQLServerException
commit in interface java.sql.ConnectionSQLServerExceptionpublic void rollback()
throws SQLServerException
rollback in interface java.sql.ConnectionSQLServerExceptionpublic void abort(java.util.concurrent.Executor executor)
throws java.sql.SQLException
abort in interface java.sql.Connectionjava.sql.SQLExceptionpublic void close()
throws SQLServerException
close in interface java.lang.AutoCloseableclose in interface java.sql.ConnectionSQLServerExceptionpublic boolean isClosed()
throws SQLServerException
isClosed in interface java.sql.ConnectionSQLServerExceptionpublic java.sql.DatabaseMetaData getMetaData()
throws SQLServerException
getMetaData in interface java.sql.ConnectionSQLServerExceptionpublic void setReadOnly(boolean readOnly)
throws SQLServerException
setReadOnly in interface java.sql.ConnectionSQLServerExceptionpublic boolean isReadOnly()
throws SQLServerException
isReadOnly in interface java.sql.ConnectionSQLServerExceptionpublic void setCatalog(java.lang.String catalog)
throws SQLServerException
setCatalog in interface java.sql.ConnectionSQLServerExceptionpublic java.lang.String getCatalog()
throws SQLServerException
getCatalog in interface java.sql.ConnectionSQLServerExceptionpublic void setTransactionIsolation(int level)
throws SQLServerException
setTransactionIsolation in interface java.sql.ConnectionSQLServerExceptionpublic int getTransactionIsolation()
throws SQLServerException
getTransactionIsolation in interface java.sql.ConnectionSQLServerExceptionpublic java.sql.SQLWarning getWarnings()
throws SQLServerException
getWarnings in interface java.sql.ConnectionSQLServerExceptionpublic void clearWarnings()
throws SQLServerException
clearWarnings in interface java.sql.ConnectionSQLServerExceptionpublic java.sql.Statement createStatement(int resultSetType,
int resultSetConcurrency)
throws SQLServerException
createStatement in interface java.sql.ConnectionSQLServerExceptionpublic java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws SQLServerException
prepareStatement in interface java.sql.ConnectionSQLServerExceptionpublic java.sql.CallableStatement prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws SQLServerException
prepareCall in interface java.sql.ConnectionSQLServerExceptionpublic void setTypeMap(java.util.Map<java.lang.String,java.lang.Class<?>> map)
throws java.sql.SQLException
setTypeMap in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.util.Map<java.lang.String,java.lang.Class<?>> getTypeMap()
throws SQLServerException
getTypeMap in interface java.sql.ConnectionSQLServerExceptionpublic java.sql.Statement createStatement(int nType,
int nConcur,
int resultSetHoldability)
throws SQLServerException
createStatement in interface java.sql.ConnectionSQLServerExceptionpublic java.sql.Statement createStatement(int nType,
int nConcur,
int resultSetHoldability,
SQLServerStatementColumnEncryptionSetting stmtColEncSetting)
throws SQLServerException
ISQLServerConnectionStatement 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.createStatement in interface ISQLServerConnectionnType - one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY,
ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVEnConcur - one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or
ResultSet.CONCUR_UPDATABLEresultSetHoldability - one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or
ResultSet.CLOSE_CURSORS_AT_COMMITstmtColEncSetting - Specifies how data will be sent and received when reading and writing encrypted columns.Statement object that will generate ResultSet objects with the given type, concurrency, and holdabilitySQLServerException - 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 holdabilitypublic java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int nType,
int nConcur,
int resultSetHoldability)
throws SQLServerException
prepareStatement in interface java.sql.ConnectionSQLServerExceptionpublic java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int nType,
int nConcur,
int resultSetHoldability,
SQLServerStatementColumnEncryptionSetting stmtColEncSetting)
throws SQLServerException
ISQLServerConnectionPreparedStatement 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.
prepareStatement in interface ISQLServerConnectionsql - a String object that is the SQL statement to be sent to the database; may contain one or more '?' IN parametersnType - one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY,
ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVEnConcur - one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or
ResultSet.CONCUR_UPDATABLEresultSetHoldability - one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or
ResultSet.CLOSE_CURSORS_AT_COMMITstmtColEncSetting - Specifies how data will be sent and received when reading and writing encrypted columns.PreparedStatement object, containing the pre-compiled SQL statement, that will generate ResultSet
objects with the given type, concurrency, and holdabilitySQLServerException - 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 holdabilitypublic java.sql.CallableStatement prepareCall(java.lang.String sql,
int nType,
int nConcur,
int resultSetHoldability)
throws SQLServerException
prepareCall in interface java.sql.ConnectionSQLServerExceptionpublic java.sql.CallableStatement prepareCall(java.lang.String sql,
int nType,
int nConcur,
int resultSetHoldability,
SQLServerStatementColumnEncryptionSetting stmtColEncSetiing)
throws SQLServerException
ISQLServerConnectionCallableStatement 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.prepareCall in interface ISQLServerConnectionsql - a String object that is the SQL statement to be sent to the database; may contain on or more '?' parametersnType - one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY,
ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVEnConcur - one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or
ResultSet.CONCUR_UPDATABLEresultSetHoldability - one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or
ResultSet.CLOSE_CURSORS_AT_COMMITstmtColEncSetiing - Specifies how data will be sent and received when reading and writing encrypted columns.CallableStatement object, containing the pre-compiled SQL statement, that will generate ResultSet
objects with the given type, concurrency, and holdabilitySQLServerException - 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 holdabilitypublic java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int flag)
throws SQLServerException
prepareStatement in interface java.sql.ConnectionSQLServerExceptionpublic java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int flag,
SQLServerStatementColumnEncryptionSetting stmtColEncSetting)
throws SQLServerException
ISQLServerConnectionPreparedStatement 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
Connection.getHoldability().
prepareStatement in interface ISQLServerConnectionsql - an SQL statement that may contain one or more '?' IN parameter placeholdersflag - a flag indicating whether auto-generated keys should be returned; one of Statement.RETURN_GENERATED_KEYS or
Statement.NO_GENERATED_KEYSstmtColEncSetting - Specifies how data will be sent and received when reading and writing encrypted columns.PreparedStatement object, containing the pre-compiled SQL statement, that will have the capability of returning
auto-generated keysSQLServerException - 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 returnedpublic java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int[] columnIndexes)
throws SQLServerException
prepareStatement in interface java.sql.ConnectionSQLServerExceptionpublic java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int[] columnIndexes,
SQLServerStatementColumnEncryptionSetting stmtColEncSetting)
throws SQLServerException
ISQLServerConnectionPreparedStatement 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
Connection.getHoldability().
prepareStatement in interface ISQLServerConnectionsql - an SQL statement that may contain one or more '?' IN parameter placeholderscolumnIndexes - an array of column indexes indicating the columns that should be returned from the inserted row or rowsstmtColEncSetting - Specifies how data will be sent and received when reading and writing encrypted columns.PreparedStatement object, containing the pre-compiled statement, that is capable of returning the auto-generated
keys designated by the given array of column indexesSQLServerException - if a database access error occurs or this method is called on a closed connectionpublic java.sql.PreparedStatement prepareStatement(java.lang.String sql,
java.lang.String[] columnNames)
throws SQLServerException
prepareStatement in interface java.sql.ConnectionSQLServerExceptionpublic java.sql.PreparedStatement prepareStatement(java.lang.String sql,
java.lang.String[] columnNames,
SQLServerStatementColumnEncryptionSetting stmtColEncSetting)
throws SQLServerException
ISQLServerConnectionPreparedStatement 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
Connection.getHoldability().
prepareStatement in interface ISQLServerConnectionsql - an SQL statement that may contain one or more '?' IN parameter placeholderscolumnNames - an array of column names indicating the columns that should be returned from the inserted row or rowsstmtColEncSetting - Specifies how data will be sent and received when reading and writing encrypted columns.PreparedStatement object, containing the pre-compiled statement, that is capable of returning the auto-generated
keys designated by the given array of column namesSQLServerException - if a database access error occurs or this method is called on a closed connectionpublic void releaseSavepoint(java.sql.Savepoint savepoint)
throws java.sql.SQLException
releaseSavepoint in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.Savepoint setSavepoint(java.lang.String sName)
throws SQLServerException
setSavepoint in interface java.sql.ConnectionSQLServerExceptionpublic java.sql.Savepoint setSavepoint()
throws SQLServerException
setSavepoint in interface java.sql.ConnectionSQLServerExceptionpublic void rollback(java.sql.Savepoint s)
throws SQLServerException
rollback in interface java.sql.ConnectionSQLServerExceptionpublic int getHoldability()
throws SQLServerException
getHoldability in interface java.sql.ConnectionSQLServerExceptionpublic void setHoldability(int holdability)
throws SQLServerException
setHoldability in interface java.sql.ConnectionSQLServerExceptionpublic int getNetworkTimeout()
throws java.sql.SQLException
getNetworkTimeout in interface java.sql.Connectionjava.sql.SQLExceptionpublic void setNetworkTimeout(java.util.concurrent.Executor executor,
int timeout)
throws java.sql.SQLException
setNetworkTimeout in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.lang.String getSchema()
throws java.sql.SQLException
getSchema in interface java.sql.Connectionjava.sql.SQLExceptionpublic void setSchema(java.lang.String schema)
throws java.sql.SQLException
setSchema in interface java.sql.Connectionjava.sql.SQLExceptionpublic void setSendTimeAsDatetime(boolean sendTimeAsDateTimeValue)
ISQLServerConnectionsetSendTimeAsDatetime in interface ISQLServerConnectionsendTimeAsDateTimeValue - 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 java.sql.Array createArrayOf(java.lang.String typeName,
java.lang.Object[] elements)
throws java.sql.SQLException
createArrayOf in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.Blob createBlob()
throws java.sql.SQLException
createBlob in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.Clob createClob()
throws java.sql.SQLException
createClob in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.NClob createNClob()
throws java.sql.SQLException
createNClob in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.SQLXML createSQLXML()
throws java.sql.SQLException
createSQLXML in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.Struct createStruct(java.lang.String typeName,
java.lang.Object[] attributes)
throws java.sql.SQLException
createStruct in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.util.Properties getClientInfo()
throws java.sql.SQLException
getClientInfo in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.lang.String getClientInfo(java.lang.String name)
throws java.sql.SQLException
getClientInfo in interface java.sql.Connectionjava.sql.SQLExceptionpublic void setClientInfo(java.util.Properties properties)
throws java.sql.SQLClientInfoException
setClientInfo in interface java.sql.Connectionjava.sql.SQLClientInfoExceptionpublic void setClientInfo(java.lang.String name,
java.lang.String value)
throws java.sql.SQLClientInfoException
setClientInfo in interface java.sql.Connectionjava.sql.SQLClientInfoExceptionpublic boolean isValid(int timeout)
throws java.sql.SQLException
isValid in interface java.sql.Connectiontimeout - The time in seconds to wait for the database operation used to validate the connection to complete. If the timeout period expires
before the operation completes, this method returns false. A value of 0 indicates a timeout is not applied to the database
operation. Note that if the value is 0, the call to isValid may block indefinitely if the connection is not valid...java.sql.SQLException - if the value supplied for the timeout is less than 0.public boolean isWrapperFor(java.lang.Class<?> iface)
throws java.sql.SQLException
isWrapperFor in interface java.sql.Wrapperjava.sql.SQLExceptionpublic <T> T unwrap(java.lang.Class<T> iface)
throws java.sql.SQLException
unwrap in interface java.sql.Wrapperjava.sql.SQLExceptionprotected void beginRequestInternal()
throws java.sql.SQLException
java.sql.SQLExceptionprotected void endRequestInternal()
throws java.sql.SQLException
java.sql.SQLExceptionpublic static void setColumnEncryptionKeyCacheTtl(int columnEncryptionKeyCacheTTL,
java.util.concurrent.TimeUnit unit)
throws SQLServerException
columnEncryptionKeyCacheTTL - The timeunit in secondsunit - The Timeunit.SQLServerException - when an error occurspublic int getDiscardedServerPreparedStatementCount()
ISQLServerConnectiongetDiscardedServerPreparedStatementCount in interface ISQLServerConnectionpublic void closeUnreferencedPreparedStatementHandles()
ISQLServerConnectioncloseUnreferencedPreparedStatementHandles in interface ISQLServerConnectionpublic boolean getEnablePrepareOnFirstPreparedStatementCall()
ISQLServerConnectiongetEnablePrepareOnFirstPreparedStatementCall in interface ISQLServerConnectionpublic void setEnablePrepareOnFirstPreparedStatementCall(boolean value)
ISQLServerConnectionsetEnablePrepareOnFirstPreparedStatementCall in interface ISQLServerConnectionvalue - Changes the setting per the description.public int getServerPreparedStatementDiscardThreshold()
ISQLServerConnectiongetServerPreparedStatementDiscardThreshold in interface ISQLServerConnectionpublic void setServerPreparedStatementDiscardThreshold(int value)
ISQLServerConnectionsetServerPreparedStatementDiscardThreshold in interface ISQLServerConnectionvalue - Changes the setting per the description.public boolean getDisableStatementPooling()
ISQLServerConnectiongetDisableStatementPooling in interface ISQLServerConnectionpublic void setDisableStatementPooling(boolean value)
ISQLServerConnectionsetDisableStatementPooling in interface ISQLServerConnectionvalue - true to disable statement pooling, false to enable it.public int getStatementPoolingCacheSize()
ISQLServerConnectiongetStatementPoolingCacheSize in interface ISQLServerConnectionpublic int getStatementHandleCacheEntryCount()
ISQLServerConnectiongetStatementHandleCacheEntryCount in interface ISQLServerConnectionpublic boolean isStatementPoolingEnabled()
ISQLServerConnectionisStatementPoolingEnabled in interface ISQLServerConnectionpublic void setStatementPoolingCacheSize(int value)
ISQLServerConnectionsetStatementPoolingCacheSize in interface ISQLServerConnectionvalue - The new cache size.Copyright © 2018 Microsoft Corporation. All rights reserved.