ISQLServerConnection
, Serializable
, AutoCloseable
, Connection
, Wrapper
SQLServerConnection43
public class SQLServerConnection extends Object implements ISQLServerConnection, 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. NOTE: All the public functions in this class also need to be defined in SQLServerConnectionPoolProxy Declare all new custom (non-static) Public APIs in ISQLServerConnection interface such that they can also be implemented by SQLServerConnectionPoolProxy
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
TRANSACTION_SNAPSHOT
Modifier and Type | Method | Description |
---|---|---|
void |
abort(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() |
|
Array |
createArrayOf(String typeName,
Object[] elements) |
|
Blob |
createBlob() |
|
Clob |
createClob() |
|
NClob |
createNClob() |
|
SQLXML |
createSQLXML() |
|
Statement |
createStatement() |
|
Statement |
createStatement(int resultSetType,
int resultSetConcurrency) |
|
Statement |
createStatement(int nType,
int nConcur,
int resultSetHoldability) |
|
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. |
Struct |
createStruct(String typeName,
Object[] attributes) |
|
protected void |
endRequestInternal() |
|
boolean |
getAutoCommit() |
|
String |
getCatalog() |
|
UUID |
getClientConnectionId() |
Returns the connection ID of the most recent connection attempt, regardless of whether the attempt succeeded or
failed.
|
Properties |
getClientInfo() |
|
String |
getClientInfo(String name) |
|
static Map<String,List<String>> |
getColumnEncryptionTrustedMasterKeyPaths() |
Returns the Trusted Master Key Paths.
|
boolean |
getDisableStatementPooling() |
Returns the value 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() |
|
DatabaseMetaData |
getMetaData() |
|
int |
getNetworkTimeout() |
|
String |
getSchema() |
|
boolean |
getSendTimeAsDatetime() |
Returns the value of 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() |
|
Map<String,Class<?>> |
getTypeMap() |
|
boolean |
getUseBulkCopyForBatchInsert() |
Returns the useBulkCopyForBatchInsert value.
|
SQLWarning |
getWarnings() |
|
boolean |
isClosed() |
|
boolean |
isReadOnly() |
|
boolean |
isStatementPoolingEnabled() |
Returns whether statement pooling is enabled or not for this connection.
|
boolean |
isValid(int timeout) |
Determine whether the connection is still valid.
|
boolean |
isWrapperFor(Class<?> iface) |
|
String |
nativeSQL(String sql) |
|
CallableStatement |
prepareCall(String sql) |
|
CallableStatement |
prepareCall(String sql,
int resultSetType,
int resultSetConcurrency) |
|
CallableStatement |
prepareCall(String sql,
int nType,
int nConcur,
int resultSetHoldability) |
|
CallableStatement |
prepareCall(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. |
PreparedStatement |
prepareStatement(String sql) |
|
PreparedStatement |
prepareStatement(String sql,
int flag) |
|
PreparedStatement |
prepareStatement(String sql,
int[] columnIndexes) |
|
PreparedStatement |
prepareStatement(String sql,
int[] columnIndexes,
SQLServerStatementColumnEncryptionSetting stmtColEncSetting) |
Creates a default
PreparedStatement object capable of returning the auto-generated keys designated
by the given array. |
PreparedStatement |
prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency) |
|
PreparedStatement |
prepareStatement(String sql,
int nType,
int nConcur,
int resultSetHoldability) |
|
PreparedStatement |
prepareStatement(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. |
PreparedStatement |
prepareStatement(String sql,
int flag,
SQLServerStatementColumnEncryptionSetting stmtColEncSetting) |
Creates a default
PreparedStatement object that has the capability to retrieve auto-generated keys. |
PreparedStatement |
prepareStatement(String sql,
String[] columnNames) |
|
PreparedStatement |
prepareStatement(String sql,
String[] columnNames,
SQLServerStatementColumnEncryptionSetting stmtColEncSetting) |
Creates a default
PreparedStatement object capable of returning the auto-generated keys designated
by the given array. |
static void |
registerColumnEncryptionKeyStoreProviders(Map<String,SQLServerColumnEncryptionKeyStoreProvider> clientKeyStoreProviders) |
Registers key store providers in the globalCustomColumnEncryptionKeyStoreProviders.
|
void |
releaseSavepoint(Savepoint savepoint) |
|
static void |
removeColumnEncryptionTrustedMasterKeyPaths(String server) |
Removes the trusted Master key Path from the columnEncryptionTrustedMasterKeyPaths.
|
void |
rollback() |
|
void |
rollback(Savepoint s) |
|
void |
setAutoCommit(boolean newAutoCommitMode) |
|
void |
setCatalog(String catalog) |
|
void |
setClientInfo(String name,
String value) |
|
void |
setClientInfo(Properties properties) |
|
static void |
setColumnEncryptionKeyCacheTtl(int columnEncryptionKeyCacheTTL,
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(Map<String,List<String>> trustedKeyPaths) |
Sets Trusted Master Key Paths in the columnEncryptionTrustedMasterKeyPaths.
|
void |
setDisableStatementPooling(boolean value) |
Sets the value to Disable/enable statement pooling.
|
void |
setEnablePrepareOnFirstPreparedStatementCall(boolean value) |
Sets the behavior for a specific connection instance.
|
void |
setHoldability(int holdability) |
|
void |
setNetworkTimeout(Executor executor,
int timeout) |
|
void |
setReadOnly(boolean readOnly) |
|
Savepoint |
setSavepoint() |
|
Savepoint |
setSavepoint(String sName) |
|
void |
setSchema(String schema) |
|
void |
setSendTimeAsDatetime(boolean sendTimeAsDateTimeValue) |
Sets the value of the sendTimeAsDatetime connection property.
|
void |
setServerPreparedStatementDiscardThreshold(int value) |
Sets the behavior for a specific connection instance.
|
void |
setStatementPoolingCacheSize(int value) |
Sets the size of the prepared statement cache for this connection.
|
void |
setTransactionIsolation(int level) |
|
void |
setTypeMap(Map<String,Class<?>> map) |
|
void |
setUseBulkCopyForBatchInsert(boolean useBulkCopyForBatchInsert) |
Specifies the flag for using Bulk Copy API for batch insert operations.
|
String |
toString() |
Provides a helper function to return an ID string suitable for tracing.
|
<T> T |
unwrap(Class<T> iface) |
|
static void |
updateColumnEncryptionTrustedMasterKeyPaths(String server,
List<String> trustedKeyPaths) |
Updates the columnEncryptionTrustedMasterKeyPaths with the new Server and trustedKeyPaths.
|
beginRequest, endRequest, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid
public boolean getUseBulkCopyForBatchInsert()
public void setUseBulkCopyForBatchInsert(boolean useBulkCopyForBatchInsert)
useBulkCopyForBatchInsert
- boolean value for useBulkCopyForBatchInsert.public final boolean getSendTimeAsDatetime()
ISQLServerConnection
getSendTimeAsDatetime
in interface ISQLServerConnection
public static void registerColumnEncryptionKeyStoreProviders(Map<String,SQLServerColumnEncryptionKeyStoreProvider> clientKeyStoreProviders) throws SQLServerException
clientKeyStoreProviders
- a map containing the store providers information.SQLServerException
- when an error occurspublic static void setColumnEncryptionTrustedMasterKeyPaths(Map<String,List<String>> trustedKeyPaths)
trustedKeyPaths
- all master key paths that are trustedpublic static void updateColumnEncryptionTrustedMasterKeyPaths(String server, List<String> trustedKeyPaths)
server
- String server nametrustedKeyPaths
- all master key paths that are trustedpublic static void removeColumnEncryptionTrustedMasterKeyPaths(String server)
server
- String server namepublic static Map<String,List<String>> getColumnEncryptionTrustedMasterKeyPaths()
public UUID getClientConnectionId() throws SQLServerException
ISQLServerConnection
getClientConnectionId
in interface ISQLServerConnection
SQLServerException
- If any errors occur.public String toString()
public Statement createStatement() throws SQLServerException
createStatement
in interface Connection
SQLServerException
public PreparedStatement prepareStatement(String sql) throws SQLServerException
prepareStatement
in interface Connection
SQLServerException
public CallableStatement prepareCall(String sql) throws SQLServerException
prepareCall
in interface Connection
SQLServerException
public String nativeSQL(String sql) throws SQLServerException
nativeSQL
in interface Connection
SQLServerException
public void setAutoCommit(boolean newAutoCommitMode) throws SQLServerException
setAutoCommit
in interface Connection
SQLServerException
public boolean getAutoCommit() throws SQLServerException
getAutoCommit
in interface Connection
SQLServerException
public void commit() throws SQLServerException
commit
in interface Connection
SQLServerException
public void rollback() throws SQLServerException
rollback
in interface Connection
SQLServerException
public void abort(Executor executor) throws SQLException
abort
in interface Connection
SQLException
public void close() throws SQLServerException
close
in interface AutoCloseable
close
in interface Connection
SQLServerException
public boolean isClosed() throws SQLServerException
isClosed
in interface Connection
SQLServerException
public DatabaseMetaData getMetaData() throws SQLServerException
getMetaData
in interface Connection
SQLServerException
public void setReadOnly(boolean readOnly) throws SQLServerException
setReadOnly
in interface Connection
SQLServerException
public boolean isReadOnly() throws SQLServerException
isReadOnly
in interface Connection
SQLServerException
public void setCatalog(String catalog) throws SQLServerException
setCatalog
in interface Connection
SQLServerException
public String getCatalog() throws SQLServerException
getCatalog
in interface Connection
SQLServerException
public void setTransactionIsolation(int level) throws SQLServerException
setTransactionIsolation
in interface Connection
SQLServerException
public int getTransactionIsolation() throws SQLServerException
getTransactionIsolation
in interface Connection
SQLServerException
public SQLWarning getWarnings() throws SQLServerException
getWarnings
in interface Connection
SQLServerException
public void clearWarnings() throws SQLServerException
clearWarnings
in interface Connection
SQLServerException
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLServerException
createStatement
in interface Connection
SQLServerException
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLServerException
prepareStatement
in interface Connection
SQLServerException
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLServerException
prepareCall
in interface Connection
SQLServerException
public void setTypeMap(Map<String,Class<?>> map) throws SQLException
setTypeMap
in interface Connection
SQLException
public Map<String,Class<?>> getTypeMap() throws SQLServerException
getTypeMap
in interface Connection
SQLServerException
public Statement createStatement(int nType, int nConcur, int resultSetHoldability) throws SQLServerException
createStatement
in interface Connection
SQLServerException
public Statement createStatement(int nType, int nConcur, int resultSetHoldability, SQLServerStatementColumnEncryptionSetting stmtColEncSetting) throws SQLServerException
ISQLServerConnection
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.createStatement
in interface ISQLServerConnection
nType
- one of the following ResultSet
constants: ResultSet.TYPE_FORWARD_ONLY
,
ResultSet.TYPE_SCROLL_INSENSITIVE
, or ResultSet.TYPE_SCROLL_SENSITIVE
nConcur
- one of the following ResultSet
constants: ResultSet.CONCUR_READ_ONLY
or
ResultSet.CONCUR_UPDATABLE
resultSetHoldability
- one of the following ResultSet
constants: ResultSet.HOLD_CURSORS_OVER_COMMIT
or
ResultSet.CLOSE_CURSORS_AT_COMMIT
stmtColEncSetting
- 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 PreparedStatement prepareStatement(String sql, int nType, int nConcur, int resultSetHoldability) throws SQLServerException
prepareStatement
in interface Connection
SQLServerException
public PreparedStatement prepareStatement(String sql, int nType, int nConcur, int resultSetHoldability, SQLServerStatementColumnEncryptionSetting stmtColEncSetting) throws SQLServerException
ISQLServerConnection
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.
prepareStatement
in interface ISQLServerConnection
sql
- 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_SENSITIVE
nConcur
- one of the following ResultSet
constants: ResultSet.CONCUR_READ_ONLY
or
ResultSet.CONCUR_UPDATABLE
resultSetHoldability
- one of the following ResultSet
constants: ResultSet.HOLD_CURSORS_OVER_COMMIT
or
ResultSet.CLOSE_CURSORS_AT_COMMIT
stmtColEncSetting
- 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 CallableStatement prepareCall(String sql, int nType, int nConcur, int resultSetHoldability) throws SQLServerException
prepareCall
in interface Connection
SQLServerException
public CallableStatement prepareCall(String sql, int nType, int nConcur, int resultSetHoldability, SQLServerStatementColumnEncryptionSetting stmtColEncSetiing) throws SQLServerException
ISQLServerConnection
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.prepareCall
in interface ISQLServerConnection
sql
- 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_SENSITIVE
nConcur
- one of the following ResultSet
constants: ResultSet.CONCUR_READ_ONLY
or
ResultSet.CONCUR_UPDATABLE
resultSetHoldability
- one of the following ResultSet
constants: ResultSet.HOLD_CURSORS_OVER_COMMIT
or
ResultSet.CLOSE_CURSORS_AT_COMMIT
stmtColEncSetiing
- 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 PreparedStatement prepareStatement(String sql, int flag) throws SQLServerException
prepareStatement
in interface Connection
SQLServerException
public PreparedStatement prepareStatement(String sql, int flag, SQLServerStatementColumnEncryptionSetting stmtColEncSetting) throws SQLServerException
ISQLServerConnection
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 Connection.getHoldability()
.
prepareStatement
in interface ISQLServerConnection
sql
- 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_KEYS
stmtColEncSetting
- 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 PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLServerException
prepareStatement
in interface Connection
SQLServerException
public PreparedStatement prepareStatement(String sql, int[] columnIndexes, SQLServerStatementColumnEncryptionSetting stmtColEncSetting) throws SQLServerException
ISQLServerConnection
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 Connection.getHoldability()
.
prepareStatement
in interface ISQLServerConnection
sql
- 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 PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLServerException
prepareStatement
in interface Connection
SQLServerException
public PreparedStatement prepareStatement(String sql, String[] columnNames, SQLServerStatementColumnEncryptionSetting stmtColEncSetting) throws SQLServerException
ISQLServerConnection
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 Connection.getHoldability()
.
prepareStatement
in interface ISQLServerConnection
sql
- 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(Savepoint savepoint) throws SQLException
releaseSavepoint
in interface Connection
SQLException
public Savepoint setSavepoint(String sName) throws SQLServerException
setSavepoint
in interface Connection
SQLServerException
public Savepoint setSavepoint() throws SQLServerException
setSavepoint
in interface Connection
SQLServerException
public void rollback(Savepoint s) throws SQLServerException
rollback
in interface Connection
SQLServerException
public int getHoldability() throws SQLServerException
getHoldability
in interface Connection
SQLServerException
public void setHoldability(int holdability) throws SQLServerException
setHoldability
in interface Connection
SQLServerException
public int getNetworkTimeout() throws SQLException
getNetworkTimeout
in interface Connection
SQLException
public void setNetworkTimeout(Executor executor, int timeout) throws SQLException
setNetworkTimeout
in interface Connection
SQLException
public String getSchema() throws SQLException
getSchema
in interface Connection
SQLException
public void setSchema(String schema) throws SQLException
setSchema
in interface Connection
SQLException
public void setSendTimeAsDatetime(boolean sendTimeAsDateTimeValue)
ISQLServerConnection
setSendTimeAsDatetime
in interface ISQLServerConnection
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 Array createArrayOf(String typeName, Object[] elements) throws SQLException
createArrayOf
in interface Connection
SQLException
public Blob createBlob() throws SQLException
createBlob
in interface Connection
SQLException
public Clob createClob() throws SQLException
createClob
in interface Connection
SQLException
public NClob createNClob() throws SQLException
createNClob
in interface Connection
SQLException
public SQLXML createSQLXML() throws SQLException
createSQLXML
in interface Connection
SQLException
public Struct createStruct(String typeName, Object[] attributes) throws SQLException
createStruct
in interface Connection
SQLException
public Properties getClientInfo() throws SQLException
getClientInfo
in interface Connection
SQLException
public String getClientInfo(String name) throws SQLException
getClientInfo
in interface Connection
SQLException
public void setClientInfo(Properties properties) throws SQLClientInfoException
setClientInfo
in interface Connection
SQLClientInfoException
public void setClientInfo(String name, String value) throws SQLClientInfoException
setClientInfo
in interface Connection
SQLClientInfoException
public boolean isValid(int timeout) throws SQLException
isValid
in interface Connection
timeout
- 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...SQLException
- if the value supplied for the timeout is less than 0.public boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor
in interface Wrapper
SQLException
public <T> T unwrap(Class<T> iface) throws SQLException
unwrap
in interface Wrapper
SQLException
protected void beginRequestInternal() throws SQLException
SQLException
protected void endRequestInternal() throws SQLException
SQLException
public static void setColumnEncryptionKeyCacheTtl(int columnEncryptionKeyCacheTTL, TimeUnit unit) throws SQLServerException
columnEncryptionKeyCacheTTL
- The timeunit in secondsunit
- The Timeunit.SQLServerException
- when an error occurspublic int getDiscardedServerPreparedStatementCount()
ISQLServerConnection
getDiscardedServerPreparedStatementCount
in interface ISQLServerConnection
public void closeUnreferencedPreparedStatementHandles()
ISQLServerConnection
closeUnreferencedPreparedStatementHandles
in interface ISQLServerConnection
public boolean getEnablePrepareOnFirstPreparedStatementCall()
ISQLServerConnection
getEnablePrepareOnFirstPreparedStatementCall
in interface ISQLServerConnection
public void setEnablePrepareOnFirstPreparedStatementCall(boolean value)
ISQLServerConnection
setEnablePrepareOnFirstPreparedStatementCall
in interface ISQLServerConnection
value
- Changes the setting per the description.public int getServerPreparedStatementDiscardThreshold()
ISQLServerConnection
getServerPreparedStatementDiscardThreshold
in interface ISQLServerConnection
public void setServerPreparedStatementDiscardThreshold(int value)
ISQLServerConnection
setServerPreparedStatementDiscardThreshold
in interface ISQLServerConnection
value
- Changes the setting per the description.public boolean getDisableStatementPooling()
ISQLServerConnection
getDisableStatementPooling
in interface ISQLServerConnection
public void setDisableStatementPooling(boolean value)
ISQLServerConnection
setDisableStatementPooling
in interface ISQLServerConnection
value
- true to disable statement pooling, false to enable it.public int getStatementPoolingCacheSize()
ISQLServerConnection
getStatementPoolingCacheSize
in interface ISQLServerConnection
public int getStatementHandleCacheEntryCount()
ISQLServerConnection
getStatementHandleCacheEntryCount
in interface ISQLServerConnection
public boolean isStatementPoolingEnabled()
ISQLServerConnection
isStatementPoolingEnabled
in interface ISQLServerConnection
public void setStatementPoolingCacheSize(int value)
ISQLServerConnection
setStatementPoolingCacheSize
in interface ISQLServerConnection
value
- The new cache size.Copyright © 2018 Microsoft Corporation. All rights reserved.