java.lang.Object
com.microsoft.sqlserver.jdbc.SQLServerDataSource
- All Implemented Interfaces:
ISQLServerDataSource
,Serializable
,Wrapper
,Referenceable
,CommonDataSource
,DataSource
- Direct Known Subclasses:
SQLServerConnectionPoolDataSource
public class SQLServerDataSource
extends Object
implements ISQLServerDataSource, DataSource, Serializable, Referenceable
Contains a list of properties specific for the
SQLServerConnection
class.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Returns the access token.Returns the application intent.Returns the application name.Returns the authentication mode.int
Returns the cancel timeout.Returns client certificate path for client certificate authentication.Returns Private key file path for client certificate authentication.Returns the Always Encrypted functionality setting for the data source object.getConnection
(String username, String password) int
Returns the maximum number of attempts set to reestablish a broken connection.int
Returns the interval set, in seconds, between attempts to reestablish a broken connection.Returns the database name.boolean
Returns the current flag value for delayLoadingLobs.Returns the DataSource descriptionboolean
Returns whether statement pooling is disabled.Returns the value for the connection property 'domain'.boolean
Returns the value that indicates whether the first execution of a prepared statement will call sp_executesql and not prepare a statement.Returns the enclave attestation protocol used in Always Encrypted with Secure Enclaves.Returns the enclave attestation URL used in Always Encrypted with Secure Enclaves.Returns the TLS encryption option.Returns the name of the failover server that is used in a database mirroring configuration.boolean
getFIPS()
Returns the value of connection property "fips".Returns the GSSCredential.Returns the host name used in validating the SQL Server Secure Sockets Layer (SSL) certificate.Returns the SQL Server instance name.Gets the preferred type of IP AddressReturns the login configuration file for Kerberos authentication.Deprecated.Returns the value of the keyStoreAuthentication setting for the data source object.Returns the keyStoreLocation for the Java Key Store.Returns the value for the connection property 'keyStorePrincipalId'.Returns the value for the connection property 'keyVaultProviderClientId'.boolean
Returns a Boolean value that indicates if the lastUpdateCount property is enabled.int
Returns an int value that indicates the number of milliseconds that the database will wait before reporting a lock time out.int
Returns the log writer for this DataSource.Returns value of 'maxResultBuffer' from Connection String.Returns the value for the connection property 'msiClientId'.int
Gets the time-to-live for the the cached MSI tokenboolean
Returns the value of the multiSubnetFailover connection property.int
Returns the current network packet size used to communicate with SQL Server, specified in bytes.int
Returns the current port number that is used to communicate with SQL Server.Returns the value indicating the prepare method.int
Returns the query timeout.getRealm()
Returns the realm for Kerberos authentication.boolean
Returns the value of the replication connection property.Returns the response buffering mode for this SQLServerDataSource object.Returns the default cursor type used for all result sets that are created by using this SQLServerDataSource object.boolean
Returns whether sending string parameters to the server in UNICODE format is enabled.boolean
Returns the current flag for value sendTemporalDataTypesAsStringForBulkCopyboolean
Returns the value of the sendTimeAsDatetime connection property.Returns the path to the server certificate.Returns the name of the SQL Server instance.boolean
Returns if the serverName should be translated from Unicode to ASCII Compatible Encoding (ACE).int
Returns the value of the setting that controls how many outstanding prepared statement discard actions (sp_unprepare) can be outstanding per connection before a call to clean-up the outstanding handles on the server is executed.Returns the server spn.Returns the value for the connection property 'socketFactoryClass'.Returns the value for the connection property 'socketFactoryConstructorArg'.int
Returns the socket timeout value.Returns the value of connection property 'sslProtocol'.int
Returns the size of the prepared statement cache for this connection.boolean
Returns the TransparentNetworkIPResolution value.Returns the value for the connection property 'trustManagerClass'.Returns the value for the connection property 'trustManagerConstructorArg'.boolean
Returns a boolean value that indicates if the trustServerCertificate property is enabled.Returns the path (including file name) to the certificate trustStore file.Returns the keyStore Type for the trustStore.getURL()
Returns the URL that is used to connect to the data source.boolean
Returns whether the use Bulk Copy API is used for Batch Insert.boolean
Returns the current flag value for useFmtOnly.getUser()
Returns the user name that is used to connect the data source.Returns the name of the client computer name that is used to connect to the data source.boolean
Returns the value that indicates if converting SQL states to XOPEN compliant states is enabled.boolean
isWrapperFor
(Class<?> iface) void
setAADSecurePrincipalId
(String AADSecurePrincipalId) Deprecated.void
setAADSecurePrincipalSecret
(String AADSecurePrincipalSecret) Deprecated.void
setAccessToken
(String accessToken) Sets the access token.void
setApplicationIntent
(String applicationIntent) Sets the application intent.void
setApplicationName
(String applicationName) Sets the specific application in various SQL Server profiling and logging tools.void
setAuthentication
(String authentication) Sets the authentication mode.void
setAuthenticationScheme
(String authenticationScheme) Sets the kind of integrated security you want your application to use.void
setCancelQueryTimeout
(int cancelQueryTimeout) Sets the cancel timeout.void
setClientCertificate
(String certPath) Sets client certificate path for client certificate authentication.void
setClientKey
(String keyPath) Sets Private key file path for client certificate authentication.void
setClientKeyPassword
(String password) Sets the password to be used for Private key provided by the user for client certificate authentication.void
setColumnEncryptionSetting
(String columnEncryptionSetting) Sets the Column Encryption setting.void
setConnectRetryCount
(int count) Sets the maximum number of attempts to reestablish a broken connection.void
setConnectRetryInterval
(int interval) Sets the interval, in seconds, between attempts to reestablish a broken connection.void
setDatabaseName
(String databaseName) Sets the the database to connect to.void
setDelayLoadingLobs
(boolean delayLoadingLobs) Specifies the flag to load LOBs instead of streaming them.void
setDescription
(String description) Sets the DataSource description.void
setDisableStatementPooling
(boolean disableStatementPooling) Sets the value to disable/enable statement pooling.void
Sets the 'domain' connection property used for NTLM Authentication.void
setEnablePrepareOnFirstPreparedStatementCall
(boolean enablePrepareOnFirstPreparedStatementCall) Sets the value that enables/disables whether the first execution of a prepared statement will call sp_executesql and not prepare a statement.void
setEnclaveAttestationProtocol
(String protocol) Sets the enclave attestation protocol to be used in Always Encrypted with Secure Enclaves.void
Sets the enclave attestation URL used in Always Encrypted with Secure Enclaves.void
setEncrypt
(boolean encryptOption) Deprecated.void
setEncrypt
(String encryptOption) Sets the option whether TLS encryption is used.void
setFailoverPartner
(String serverName) Sets the fail over partner of the target SQL Server.void
setFIPS
(boolean fips) Sets whether Fips Mode should be enabled/disabled on the connection.void
setGSSCredentials
(GSSCredential userCredential) Sets the GSSCredential.void
setHostNameInCertificate
(String hostName) Sets the host name to be used in validating the SQL Server Secure Sockets Layer (SSL) certificate.void
setInstanceName
(String instanceName) Sets the the SQL Server instance name to connect to.void
setIntegratedSecurity
(boolean enable) Sets a Boolean value that indicates if the integratedSecurity property is enabled.void
setIPAddressPreference
(String iPAddressPreference) Set the preferred type of IP Addressvoid
setJAASConfigurationName
(String configurationName) Sets the login configuration file for Kerberos authentication.void
setJASSConfigurationName
(String configurationName) Deprecated.void
setKeyStoreAuthentication
(String keyStoreAuthentication) Sets the name that identifies a key store.void
setKeyStoreLocation
(String keyStoreLocation) Sets the location including the file name for the Java keystore.void
setKeyStorePrincipalId
(String keyStorePrincipalId) Sets the value for the connection property 'keyStorePrincipalId'.void
setKeyStoreSecret
(String keyStoreSecret) Sets the password for the Java keystore.void
setKeyVaultProviderClientId
(String keyVaultProviderClientId) Sets the Azure Key Vault (AKV) Provider Client Id to provided value to be used for column encryption.void
setKeyVaultProviderClientKey
(String keyVaultProviderClientKey) Sets the Azure Key Vault (AKV) Provider Client Key to provided value to be used for column encryption.void
setLastUpdateCount
(boolean lastUpdateCount) Sets a Boolean value that indicates if the lastUpdateCount property is enabled.void
setLockTimeout
(int lockTimeout) Sets the lock timeout value.void
setLoginTimeout
(int loginTimeout) Sets the maximum time in seconds that this data source will wait while attempting to connect to a database.void
setLogWriter
(PrintWriter out) void
setMaxResultBuffer
(String maxResultBuffer) Sets the value for 'maxResultBuffer' propertyvoid
setMSIClientId
(String msiClientId) Sets the client id to be used to retrieve access token from MSI EndPoint.void
setMsiTokenCacheTtl
(int timeToLive) Sets time-to-live for the the cached MSI tokenvoid
setMultiSubnetFailover
(boolean multiSubnetFailover) Sets the value of the multiSubnetFailover connection property.void
setPacketSize
(int packetSize) Sets the packet size.void
setPassword
(String password) Sets the password that will be used when connecting to SQL Server.void
setPortNumber
(int portNumber) Sets the TCP-IP port number used when opening a socket connection to SQL Server.void
setPrepareMethod
(String prepareMethod) Sets the behavior for the prepare method.void
setQueryTimeout
(int queryTimeout) Setting the query timeout.void
Sets the realm for Kerberos authentication.void
setReplication
(boolean replication) Sets the value to enable/disable the replication connection property.void
setResponseBuffering
(String bufferingMode) Sets the response buffering mode for connections created by using this SQLServerDataSource object.void
setSelectMethod
(String selectMethod) Sets the default cursor type used for the result set.void
setSendStringParametersAsUnicode
(boolean sendStringParametersAsUnicode) Sets whether string parameters are sent to the server in UNICODE format.void
setSendTemporalDataTypesAsStringForBulkCopy
(boolean sendTemporalDataTypesAsStringForBulkCopy) Specifies the flag to send temporal datatypes as String for Bulk Copy.void
setSendTimeAsDatetime
(boolean sendTimeAsDatetime) Sets the value to enable/disable the sendTimeAsDatetime connection property.void
setServerCertificate
(String cert) Sets the connection property 'serverCertificate' on the connection.void
setServerName
(String serverName) Sets the host name of the target SQL Server.void
setServerNameAsACE
(boolean serverNameAsACE) Sets whether the serverName will be translated from Unicode to ASCII Compatible Encoding (ACE).void
setServerPreparedStatementDiscardThreshold
(int serverPreparedStatementDiscardThreshold) Sets the value that controls how many outstanding prepared statement discard actions (sp_unprepare) can be outstanding per connection before a call to clean-up the outstanding handles on the server is executed.void
setServerSpn
(String serverSpn) Sets the Service Principal Name (SPN) of the target SQL Server.void
setSocketFactoryClass
(String socketFactoryClass) Sets the connection property 'socketFactoryClass' on the connection.void
setSocketFactoryConstructorArg
(String socketFactoryConstructorArg) Sets Constructor Arguments to be provided on constructor of 'socketFactoryClass'.void
setSocketTimeout
(int socketTimeout) Sets the socket timeout value.void
setSSLProtocol
(String sslProtocol) Sets the sslProtocol property for connection Set this value to specify TLS protocol keyword.void
setStatementPoolingCacheSize
(int statementPoolingCacheSize) Sets the size of the prepared statement cache for this connection.void
setTransparentNetworkIPResolution
(boolean tnir) Sets the value to enable/disable Transparent Network IP Resolution (TNIR).void
setTrustManagerClass
(String trustManagerClass) Sets the connection property 'trustManagerClass' on the connection.void
setTrustManagerConstructorArg
(String trustManagerConstructorArg) Sets Constructor Arguments to be provided on constructor of 'trustManagerClass'.void
setTrustServerCertificate
(boolean e) Sets a boolean value that indicates if the trustServerCertificate property is enabled.void
setTrustStore
(String trustStore) Sets the path (including file name) to the certificate trustStore file.void
setTrustStorePassword
(String trustStorePassword) Sets the password that is used to check the integrity of the trustStore data.void
setTrustStoreType
(String trustStoreType) Sets the keystore type for the trustStore.void
Sets the datasource URL.void
setUseBulkCopyForBatchInsert
(boolean useBulkCopyForBatchInsert) Sets whether the use Bulk Copy API should be used for Batch Insert.void
setUseFmtOnly
(boolean useFmtOnly) Specifies the flag to use FMTONLY for parameter metadata queries.void
Sets the user name that will be used when connecting to SQL Server.void
setWorkstationID
(String workstationID) Sets the name of the client machine (or client workstation).void
setXopenStates
(boolean xopenStates) Sets whether the driver will convert SQL states to XOPEN compliant states.toString()
<T> T
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilder
Methods inherited from interface javax.sql.DataSource
createConnectionBuilder
-
Constructor Details
-
SQLServerDataSource
public SQLServerDataSource()Constructs a SQLServerDataSource.
-
-
Method Details
-
toString
-
getConnection
- Specified by:
getConnection
in interfaceDataSource
- Throws:
SQLServerException
-
getConnection
- Specified by:
getConnection
in interfaceDataSource
- Throws:
SQLServerException
-
setLoginTimeout
public void setLoginTimeout(int loginTimeout) Sets the maximum time in seconds that this data source will wait while attempting to connect to a database. Note default value is 0.- Specified by:
setLoginTimeout
in interfaceCommonDataSource
- Specified by:
setLoginTimeout
in interfaceDataSource
-
getLoginTimeout
public int getLoginTimeout()- Specified by:
getLoginTimeout
in interfaceCommonDataSource
- Specified by:
getLoginTimeout
in interfaceDataSource
-
setLogWriter
- Specified by:
setLogWriter
in interfaceCommonDataSource
- Specified by:
setLogWriter
in interfaceDataSource
-
getLogWriter
Returns the log writer for this DataSource.- Specified by:
getLogWriter
in interfaceCommonDataSource
- Specified by:
getLogWriter
in interfaceDataSource
-
getParentLogger
- Specified by:
getParentLogger
in interfaceCommonDataSource
- Throws:
SQLFeatureNotSupportedException
-
setApplicationName
Sets the specific application in various SQL Server profiling and logging tools.- Specified by:
setApplicationName
in interfaceISQLServerDataSource
- Parameters:
applicationName
- A String that contains the name of the application.
-
getApplicationName
Description copied from interface:ISQLServerDataSource
Returns the application name.- Specified by:
getApplicationName
in interfaceISQLServerDataSource
- Returns:
- A String that contains the application name, or "Microsoft JDBC Driver for SQL Server" if no value is set.
-
setDatabaseName
Sets the the database to connect to.- Specified by:
setDatabaseName
in interfaceISQLServerDataSource
- Parameters:
databaseName
- if not set, returns the default value of null.
-
getDatabaseName
Description copied from interface:ISQLServerDataSource
Returns the database name.- Specified by:
getDatabaseName
in interfaceISQLServerDataSource
- Returns:
- A String that contains the database name or null if no value is set.
-
setInstanceName
Sets the the SQL Server instance name to connect to.- Specified by:
setInstanceName
in interfaceISQLServerDataSource
- Parameters:
instanceName
- if not set, returns the default value of null.
-
getInstanceName
Description copied from interface:ISQLServerDataSource
Returns the SQL Server instance name.- Specified by:
getInstanceName
in interfaceISQLServerDataSource
- Returns:
- A String that contains the instance name, or null if no value is set.
-
setIntegratedSecurity
public void setIntegratedSecurity(boolean enable) Description copied from interface:ISQLServerDataSource
Sets a Boolean value that indicates if the integratedSecurity property is enabled.- Specified by:
setIntegratedSecurity
in interfaceISQLServerDataSource
- Parameters:
enable
- true if integratedSecurity is enabled. Otherwise, false.
-
setAuthenticationScheme
Description copied from interface:ISQLServerDataSource
Sets the kind of integrated security you want your application to use.- Specified by:
setAuthenticationScheme
in interfaceISQLServerDataSource
- Parameters:
authenticationScheme
- Values are "JavaKerberos" and the default "NativeAuthentication".
-
setAuthentication
Description copied from interface:ISQLServerDataSource
Sets the authentication mode.- Specified by:
setAuthentication
in interfaceISQLServerDataSource
- Parameters:
authentication
- the authentication mode
-
getAuthentication
Description copied from interface:ISQLServerDataSource
Returns the authentication mode.- Specified by:
getAuthentication
in interfaceISQLServerDataSource
- Returns:
- the authentication value
-
setGSSCredentials
Description copied from interface:ISQLServerDataSource
Sets the GSSCredential.- Specified by:
setGSSCredentials
in interfaceISQLServerDataSource
- Parameters:
userCredential
- the credential
-
getGSSCredentials
Description copied from interface:ISQLServerDataSource
Returns the GSSCredential.- Specified by:
getGSSCredentials
in interfaceISQLServerDataSource
- Returns:
- GSSCredential
-
setAccessToken
Description copied from interface:ISQLServerDataSource
Sets the access token.- Specified by:
setAccessToken
in interfaceISQLServerDataSource
- Parameters:
accessToken
- to be set in the string property.
-
getAccessToken
Description copied from interface:ISQLServerDataSource
Returns the access token.- Specified by:
getAccessToken
in interfaceISQLServerDataSource
- Returns:
- the access token.
-
setColumnEncryptionSetting
Sets the Column Encryption setting. If lastUpdateCount is set to true, the driver will return only the last update count from all the update counts returned by a batch. The default of false will return all update counts. If lastUpdateCount is not set, getLastUpdateCount returns the default value of false.- Specified by:
setColumnEncryptionSetting
in interfaceISQLServerDataSource
- Parameters:
columnEncryptionSetting
- Enables/disables Always Encrypted functionality for the data source object. The default is Disabled.
-
getColumnEncryptionSetting
Description copied from interface:ISQLServerDataSource
Returns the Always Encrypted functionality setting for the data source object.- Specified by:
getColumnEncryptionSetting
in interfaceISQLServerDataSource
- Returns:
- the Always Encrypted functionality setting for the data source object.
-
setKeyStoreAuthentication
Description copied from interface:ISQLServerDataSource
Sets the name that identifies a key store. Only value supported is the "JavaKeyStorePassword" for identifying the Java Key Store. The default is null.- Specified by:
setKeyStoreAuthentication
in interfaceISQLServerDataSource
- Parameters:
keyStoreAuthentication
- the name that identifies a key store.
-
getKeyStoreAuthentication
Description copied from interface:ISQLServerDataSource
Returns the value of the keyStoreAuthentication setting for the data source object.- Specified by:
getKeyStoreAuthentication
in interfaceISQLServerDataSource
- Returns:
- the value of the keyStoreAuthentication setting for the data source object.
-
setKeyStoreSecret
Description copied from interface:ISQLServerDataSource
Sets the password for the Java keystore. Note that, for Java Key Store provider the password for the keystore and the key must be the same. Note that, keyStoreAuthentication must be set with "JavaKeyStorePassword".- Specified by:
setKeyStoreSecret
in interfaceISQLServerDataSource
- Parameters:
keyStoreSecret
- the password to use for the keystore as well as for the key
-
setKeyStoreLocation
Description copied from interface:ISQLServerDataSource
Sets the location including the file name for the Java keystore. Note that, keyStoreAuthentication must be set with "JavaKeyStorePassword".- Specified by:
setKeyStoreLocation
in interfaceISQLServerDataSource
- Parameters:
keyStoreLocation
- the location including the file name for the Java keystore.
-
getKeyStoreLocation
Description copied from interface:ISQLServerDataSource
Returns the keyStoreLocation for the Java Key Store.- Specified by:
getKeyStoreLocation
in interfaceISQLServerDataSource
- Returns:
- the keyStoreLocation for the Java Key Store.
-
setLastUpdateCount
public void setLastUpdateCount(boolean lastUpdateCount) Description copied from interface:ISQLServerDataSource
Sets a Boolean value that indicates if the lastUpdateCount property is enabled.- Specified by:
setLastUpdateCount
in interfaceISQLServerDataSource
- Parameters:
lastUpdateCount
- true if lastUpdateCount is enabled. Otherwise, false.
-
getLastUpdateCount
public boolean getLastUpdateCount()Description copied from interface:ISQLServerDataSource
Returns a Boolean value that indicates if the lastUpdateCount property is enabled.- Specified by:
getLastUpdateCount
in interfaceISQLServerDataSource
- Returns:
- true if lastUpdateCount is enabled. Otherwise, false.
-
setEncrypt
Description copied from interface:ISQLServerDataSource
Sets the option whether TLS encryption is used.- Specified by:
setEncrypt
in interfaceISQLServerDataSource
- Parameters:
encryptOption
- TLS encrypt option. Default is "true"
-
setEncrypt
Deprecated.Description copied from interface:ISQLServerDataSource
Sets the option whether TLS encryption is used.- Specified by:
setEncrypt
in interfaceISQLServerDataSource
- Parameters:
encryptOption
- TLS encrypt option. Default is true
-
getEncrypt
Description copied from interface:ISQLServerDataSource
Returns the TLS encryption option.- Specified by:
getEncrypt
in interfaceISQLServerDataSource
- Returns:
- the TLS encrypt option
-
setServerCertificate
Description copied from interface:ISQLServerDataSource
Sets the connection property 'serverCertificate' on the connection.- Specified by:
setServerCertificate
in interfaceISQLServerDataSource
- Parameters:
cert
- The path to the server certificate.
-
getServerCertificate
Description copied from interface:ISQLServerDataSource
Returns the path to the server certificate.- Specified by:
getServerCertificate
in interfaceISQLServerDataSource
- Returns:
- serverCertificate property value
-
setTransparentNetworkIPResolution
public void setTransparentNetworkIPResolution(boolean tnir) Description copied from interface:ISQLServerDataSource
Sets the value to enable/disable Transparent Network IP Resolution (TNIR). Beginning in version 6.0 of the Microsoft JDBC Driver for SQL Server, a new connection property transparentNetworkIPResolution (TNIR) is added for transparent connection to Always On availability groups or to a server which has multiple IP addresses associated. When transparentNetworkIPResolution is true, the driver attempts to connect to the first IP address available. If the first attempt fails, the driver tries to connect to all IP addresses in parallel until the timeout expires, discarding any pending connection attempts when one of them succeeds.transparentNetworkIPResolution is ignored if multiSubnetFailover is true
transparentNetworkIPResolution is ignored if database mirroring is used
transparentNetworkIPResolution is ignored if there are more than 64 IP addresses
- Specified by:
setTransparentNetworkIPResolution
in interfaceISQLServerDataSource
- Parameters:
tnir
- if set to true, the driver attempts to connect to the first IP address available. It is true by default.
-
getTransparentNetworkIPResolution
public boolean getTransparentNetworkIPResolution()Description copied from interface:ISQLServerDataSource
Returns the TransparentNetworkIPResolution value.- Specified by:
getTransparentNetworkIPResolution
in interfaceISQLServerDataSource
- Returns:
- if enabled, returns true. Otherwise, false.
-
setTrustServerCertificate
public void setTrustServerCertificate(boolean e) Description copied from interface:ISQLServerDataSource
Sets a boolean value that indicates if the trustServerCertificate property is enabled.- Specified by:
setTrustServerCertificate
in interfaceISQLServerDataSource
- Parameters:
e
- true, if the server Secure Sockets Layer (SSL) certificate should be automatically trusted when the communication layer is encrypted using SSL. false, if server SLL certificate should not be trusted certificate location, if encrypt=strict
-
getTrustServerCertificate
public boolean getTrustServerCertificate()Description copied from interface:ISQLServerDataSource
Returns a boolean value that indicates if the trustServerCertificate property is enabled.- Specified by:
getTrustServerCertificate
in interfaceISQLServerDataSource
- Returns:
- true if trustServerCertificate is enabled. Otherwise, false. If encrypt=strict, returns server certificate location
-
setTrustStoreType
Description copied from interface:ISQLServerDataSource
Sets the keystore type for the trustStore.- Specified by:
setTrustStoreType
in interfaceISQLServerDataSource
- Parameters:
trustStoreType
- A String that contains the trust store type
-
getTrustStoreType
Description copied from interface:ISQLServerDataSource
Returns the keyStore Type for the trustStore.- Specified by:
getTrustStoreType
in interfaceISQLServerDataSource
- Returns:
- trustStoreType A String that contains the trust store type
-
setTrustStore
Description copied from interface:ISQLServerDataSource
Sets the path (including file name) to the certificate trustStore file.- Specified by:
setTrustStore
in interfaceISQLServerDataSource
- Parameters:
trustStore
- A String that contains the path (including file name) to the certificate trustStore file.
-
getTrustStore
Description copied from interface:ISQLServerDataSource
Returns the path (including file name) to the certificate trustStore file.- Specified by:
getTrustStore
in interfaceISQLServerDataSource
- Returns:
- trustStore A String that contains the path (including file name) to the certificate trustStore file, or null if no value is set.
-
setTrustStorePassword
Description copied from interface:ISQLServerDataSource
Sets the password that is used to check the integrity of the trustStore data.- Specified by:
setTrustStorePassword
in interfaceISQLServerDataSource
- Parameters:
trustStorePassword
- A String that contains the password that is used to check the integrity of the trustStore data.
-
setHostNameInCertificate
Description copied from interface:ISQLServerDataSource
Sets the host name to be used in validating the SQL Server Secure Sockets Layer (SSL) certificate.- Specified by:
setHostNameInCertificate
in interfaceISQLServerDataSource
- Parameters:
hostName
- A String that contains the host name.
-
getHostNameInCertificate
Description copied from interface:ISQLServerDataSource
Returns the host name used in validating the SQL Server Secure Sockets Layer (SSL) certificate.- Specified by:
getHostNameInCertificate
in interfaceISQLServerDataSource
- Returns:
- A String that contains the host name, or null if no value is set.
-
setLockTimeout
public void setLockTimeout(int lockTimeout) Sets the lock timeout value.- Specified by:
setLockTimeout
in interfaceISQLServerDataSource
- Parameters:
lockTimeout
- the number of milliseconds to wait before the database reports a lock timeout. The default value of -1 means wait forever. If specified, this value will be the default for all statements on the connection. Note a value of 0 means no wait. If lockTimeout is not set, getLockTimeout returns the default of -1.
-
getLockTimeout
public int getLockTimeout()Description copied from interface:ISQLServerDataSource
Returns an int value that indicates the number of milliseconds that the database will wait before reporting a lock time out.- Specified by:
getLockTimeout
in interfaceISQLServerDataSource
- Returns:
- An int value that contains the number of milliseconds that the database will wait.
-
setPassword
Sets the password that will be used when connecting to SQL Server.- Specified by:
setPassword
in interfaceISQLServerDataSource
- Parameters:
password
- Note getPassword is deliberately declared non-public for security reasons. If the password is not set, getPassword returns the default value of null.
-
setPortNumber
public void setPortNumber(int portNumber) Sets the TCP-IP port number used when opening a socket connection to SQL Server.- Specified by:
setPortNumber
in interfaceISQLServerDataSource
- Parameters:
portNumber
- if not set, getPortNumber returns the default of 1433. Note as mentioned above, setPortNumber does not do any range checking on the port value passed in,\ invalid port numbers like 99999 can be passed in without triggering any error.
-
getPortNumber
public int getPortNumber()Description copied from interface:ISQLServerDataSource
Returns the current port number that is used to communicate with SQL Server.- Specified by:
getPortNumber
in interfaceISQLServerDataSource
- Returns:
- An int value that contains the current port number.
-
setSelectMethod
Sets the default cursor type used for the result set.- Specified by:
setSelectMethod
in interfaceISQLServerDataSource
- Parameters:
selectMethod
- This(non-Javadoc) @see com.microsoft.sqlserver.jdbc.ISQLServerDataSource#setSelectMethod(java.lang.String) property is useful when you are dealing with large result sets and do not want to store the whole result set in memory on the client side. By setting the property to "cursor" you will be able to create a server side cursor that can fetch smaller chunks of data at a time. If selectMethod is not set, getSelectMethod returns the default value of "direct".
-
getSelectMethod
Description copied from interface:ISQLServerDataSource
Returns the default cursor type used for all result sets that are created by using this SQLServerDataSource object.- Specified by:
getSelectMethod
in interfaceISQLServerDataSource
- Returns:
- A String value that contains the default cursor type.
-
setResponseBuffering
Description copied from interface:ISQLServerDataSource
Sets the response buffering mode for connections created by using this SQLServerDataSource object.- Specified by:
setResponseBuffering
in interfaceISQLServerDataSource
- Parameters:
bufferingMode
- A String that contains the buffering and streaming mode. The valid mode can be one of the following case-insensitive Strings: full or adaptive.
-
getResponseBuffering
Description copied from interface:ISQLServerDataSource
Returns the response buffering mode for this SQLServerDataSource object.- Specified by:
getResponseBuffering
in interfaceISQLServerDataSource
- Returns:
- A String that contains a lower-case full or adaptive.
-
setApplicationIntent
Description copied from interface:ISQLServerDataSource
Sets the application intent.- Specified by:
setApplicationIntent
in interfaceISQLServerDataSource
- Parameters:
applicationIntent
- A String that contains the application intent.
-
getApplicationIntent
Description copied from interface:ISQLServerDataSource
Returns the application intent.- Specified by:
getApplicationIntent
in interfaceISQLServerDataSource
- Returns:
- A String that contains the application intent.
-
setReplication
public void setReplication(boolean replication) Description copied from interface:ISQLServerDataSource
Sets the value to enable/disable the replication connection property.- Specified by:
setReplication
in interfaceISQLServerDataSource
- Parameters:
replication
- A Boolean value. When true, tells the server that the connection is used for replication.
-
getReplication
public boolean getReplication()Description copied from interface:ISQLServerDataSource
Returns the value of the replication connection property.- Specified by:
getReplication
in interfaceISQLServerDataSource
- Returns:
- true if the connection is to be used for replication. Otherwise false.
-
setSendTimeAsDatetime
public void setSendTimeAsDatetime(boolean sendTimeAsDatetime) Description copied from interface:ISQLServerDataSource
Sets the value to enable/disable the sendTimeAsDatetime connection property.- Specified by:
setSendTimeAsDatetime
in interfaceISQLServerDataSource
- Parameters:
sendTimeAsDatetime
- A Boolean value. When true, causes java.sql.Time values to be sent to the server as SQL Server datetime types. When false, causes java.sql.Time values to be sent to the server as SQL Server time types.
-
getSendTimeAsDatetime
public boolean getSendTimeAsDatetime()Description copied from interface:ISQLServerDataSource
Returns the value of the sendTimeAsDatetime connection property. This method was added in SQL Server JDBC Driver 3.0. Returns the setting of the sendTimeAsDatetime connection property.- Specified by:
getSendTimeAsDatetime
in interfaceISQLServerDataSource
- Returns:
- true if java.sql.Time values will be sent to the server as a SQL Server datetime type. false if java.sql.Time values will be sent to the server as a SQL Server time type.
-
setUseFmtOnly
public void setUseFmtOnly(boolean useFmtOnly) Description copied from interface:ISQLServerDataSource
Specifies the flag to use FMTONLY for parameter metadata queries.- Specified by:
setUseFmtOnly
in interfaceISQLServerDataSource
- Parameters:
useFmtOnly
- boolean value for 'useFmtOnly'.
-
getUseFmtOnly
public boolean getUseFmtOnly()Description copied from interface:ISQLServerDataSource
Returns the current flag value for useFmtOnly.- Specified by:
getUseFmtOnly
in interfaceISQLServerDataSource
- Returns:
- 'useFmtOnly' property value.
-
setDelayLoadingLobs
public void setDelayLoadingLobs(boolean delayLoadingLobs) Description copied from interface:ISQLServerDataSource
Specifies the flag to load LOBs instead of streaming them.- Specified by:
setDelayLoadingLobs
in interfaceISQLServerDataSource
- Parameters:
delayLoadingLobs
- boolean value for 'delayLoadingLobs'.
-
getDelayLoadingLobs
public boolean getDelayLoadingLobs()Description copied from interface:ISQLServerDataSource
Returns the current flag value for delayLoadingLobs.- Specified by:
getDelayLoadingLobs
in interfaceISQLServerDataSource
- Returns:
- 'delayLoadingLobs' property value.
-
setSendStringParametersAsUnicode
public void setSendStringParametersAsUnicode(boolean sendStringParametersAsUnicode) Sets whether string parameters are sent to the server in UNICODE format.- Specified by:
setSendStringParametersAsUnicode
in interfaceISQLServerDataSource
- Parameters:
sendStringParametersAsUnicode
- if true (default), string parameters are sent to the server in UNICODE format. if false, string parameters are sent to the server in the native TDS collation format of the database, not in UNICODE. if set, returns the default of true.
-
getSendStringParametersAsUnicode
public boolean getSendStringParametersAsUnicode()Description copied from interface:ISQLServerDataSource
Returns whether sending string parameters to the server in UNICODE format is enabled.- Specified by:
getSendStringParametersAsUnicode
in interfaceISQLServerDataSource
- Returns:
- true if string parameters are sent to the server in UNICODE format. Otherwise, false.
-
setServerNameAsACE
public void setServerNameAsACE(boolean serverNameAsACE) Description copied from interface:ISQLServerDataSource
Sets whether the serverName will be translated from Unicode to ASCII Compatible Encoding (ACE).- Specified by:
setServerNameAsACE
in interfaceISQLServerDataSource
- Parameters:
serverNameAsACE
- if enabled the servername will be translated to ASCII Compatible Encoding (ACE)
-
getServerNameAsACE
public boolean getServerNameAsACE()Description copied from interface:ISQLServerDataSource
Returns if the serverName should be translated from Unicode to ASCII Compatible Encoding (ACE).- Specified by:
getServerNameAsACE
in interfaceISQLServerDataSource
- Returns:
- if enabled, will return true. Otherwise, false.
-
setServerName
Sets the host name of the target SQL Server.- Specified by:
setServerName
in interfaceISQLServerDataSource
- Parameters:
serverName
- if not set, returns the default value of null is returned.
-
getServerName
Description copied from interface:ISQLServerDataSource
Returns the name of the SQL Server instance.- Specified by:
getServerName
in interfaceISQLServerDataSource
- Returns:
- A String that contains the server name or null if no value is set.
-
setIPAddressPreference
Set the preferred type of IP Address- Specified by:
setIPAddressPreference
in interfaceISQLServerDataSource
- Parameters:
iPAddressPreference
- Preferred IP Address type
-
getIPAddressPreference
Gets the preferred type of IP Address- Specified by:
getIPAddressPreference
in interfaceISQLServerDataSource
- Returns:
- IPAddressPreference A String that contains the preferred type of IP Address.
-
setRealm
Sets the realm for Kerberos authentication.- Specified by:
setRealm
in interfaceISQLServerDataSource
- Parameters:
realm
- realm
-
getRealm
Description copied from interface:ISQLServerDataSource
Returns the realm for Kerberos authentication.- Specified by:
getRealm
in interfaceISQLServerDataSource
- Returns:
- A String that contains the realm
-
setServerSpn
Sets the Service Principal Name (SPN) of the target SQL Server. https://msdn.microsoft.com/en-us/library/cc280459.aspx- Specified by:
setServerSpn
in interfaceISQLServerDataSource
- Parameters:
serverSpn
- service principal name
-
getServerSpn
Description copied from interface:ISQLServerDataSource
Returns the server spn.- Specified by:
getServerSpn
in interfaceISQLServerDataSource
- Returns:
- A String that contains the server spn
-
setFailoverPartner
Sets the fail over partner of the target SQL Server.- Specified by:
setFailoverPartner
in interfaceISQLServerDataSource
- Parameters:
serverName
- if not set, returns the default value of null.
-
getFailoverPartner
Description copied from interface:ISQLServerDataSource
Returns the name of the failover server that is used in a database mirroring configuration.- Specified by:
getFailoverPartner
in interfaceISQLServerDataSource
- Returns:
- A String that contains the name of the failover partner, or null if none is set.
-
setMultiSubnetFailover
public void setMultiSubnetFailover(boolean multiSubnetFailover) Description copied from interface:ISQLServerDataSource
Sets the value of the multiSubnetFailover connection property.- Specified by:
setMultiSubnetFailover
in interfaceISQLServerDataSource
- Parameters:
multiSubnetFailover
- The new value of the multiSubnetFailover connection property.
-
getMultiSubnetFailover
public boolean getMultiSubnetFailover()Description copied from interface:ISQLServerDataSource
Returns the value of the multiSubnetFailover connection property.- Specified by:
getMultiSubnetFailover
in interfaceISQLServerDataSource
- Returns:
- Returns true or false, depending on the current setting of the connection property.
-
setUser
Sets the user name that will be used when connecting to SQL Server.- Specified by:
setUser
in interfaceISQLServerDataSource
- Parameters:
user
- if not set, returns the default value of null.
-
getUser
Description copied from interface:ISQLServerDataSource
Returns the user name that is used to connect the data source.- Specified by:
getUser
in interfaceISQLServerDataSource
- Returns:
- A String that contains the user name.
-
setWorkstationID
Sets the name of the client machine (or client workstation).- Specified by:
setWorkstationID
in interfaceISQLServerDataSource
- Parameters:
workstationID
- host name of the client. if not set, the default value is constructed by calling InetAddress.getLocalHost().getHostName() or if getHostName() returns blank then getHostAddress().toString().
-
getWorkstationID
Description copied from interface:ISQLServerDataSource
Returns the name of the client computer name that is used to connect to the data source.- Specified by:
getWorkstationID
in interfaceISQLServerDataSource
- Returns:
- A String that contains the client computer name.
-
setXopenStates
public void setXopenStates(boolean xopenStates) Sets whether the driver will convert SQL states to XOPEN compliant states.- Specified by:
setXopenStates
in interfaceISQLServerDataSource
- Parameters:
xopenStates
- if true, the driver will convert SQL states to XOPEN compliant states. The default is false which causes the driver to generate SQL 99 state codes. If not set, getXopenStates returns the default value of false.
-
getXopenStates
public boolean getXopenStates()Description copied from interface:ISQLServerDataSource
Returns the value that indicates if converting SQL states to XOPEN compliant states is enabled.- Specified by:
getXopenStates
in interfaceISQLServerDataSource
- Returns:
- true if converting SQL states to XOPEN compliant states is enabled. Otherwise, false.
-
setFIPS
public void setFIPS(boolean fips) Description copied from interface:ISQLServerDataSource
Sets whether Fips Mode should be enabled/disabled on the connection. For FIPS enabled JVM this property should be true.- Specified by:
setFIPS
in interfaceISQLServerDataSource
- Parameters:
fips
- Boolean property to enable/disable fips
-
getFIPS
public boolean getFIPS()Description copied from interface:ISQLServerDataSource
Returns the value of connection property "fips". For FIPS enabled JVM this property should be true.- Specified by:
getFIPS
in interfaceISQLServerDataSource
- Returns:
- fips boolean value
-
getSocketFactoryClass
Description copied from interface:ISQLServerDataSource
Returns the value for the connection property 'socketFactoryClass'.- Specified by:
getSocketFactoryClass
in interfaceISQLServerDataSource
- Returns:
- socketFactoryClass property value
-
setSocketFactoryClass
Description copied from interface:ISQLServerDataSource
Sets the connection property 'socketFactoryClass' on the connection.- Specified by:
setSocketFactoryClass
in interfaceISQLServerDataSource
- Parameters:
socketFactoryClass
- The fully qualified class name of a custom javax.net.SocketFactory.
-
getSocketFactoryConstructorArg
Description copied from interface:ISQLServerDataSource
Returns the value for the connection property 'socketFactoryConstructorArg'.- Specified by:
getSocketFactoryConstructorArg
in interfaceISQLServerDataSource
- Returns:
- socketFactoryConstructorArg property value
-
setSocketFactoryConstructorArg
Description copied from interface:ISQLServerDataSource
Sets Constructor Arguments to be provided on constructor of 'socketFactoryClass'.- Specified by:
setSocketFactoryConstructorArg
in interfaceISQLServerDataSource
- Parameters:
socketFactoryConstructorArg
- 'socketFactoryClass' constructor arguments
-
setSSLProtocol
Description copied from interface:ISQLServerDataSource
Sets the sslProtocol property for connection Set this value to specify TLS protocol keyword. Acceptable values are: TLS, TLSv1, TLSv1.1, and TLSv1.2.- Specified by:
setSSLProtocol
in interfaceISQLServerDataSource
- Parameters:
sslProtocol
- Value for SSL Protocol to be set.
-
getSSLProtocol
Description copied from interface:ISQLServerDataSource
Returns the value of connection property 'sslProtocol'.- Specified by:
getSSLProtocol
in interfaceISQLServerDataSource
- Returns:
- sslProtocol property value
-
setTrustManagerClass
Description copied from interface:ISQLServerDataSource
Sets the connection property 'trustManagerClass' on the connection.- Specified by:
setTrustManagerClass
in interfaceISQLServerDataSource
- Parameters:
trustManagerClass
- The fully qualified class name of a custom javax.net.ssl.TrustManager.
-
getTrustManagerClass
Description copied from interface:ISQLServerDataSource
Returns the value for the connection property 'trustManagerClass'.- Specified by:
getTrustManagerClass
in interfaceISQLServerDataSource
- Returns:
- trustManagerClass property value
-
setTrustManagerConstructorArg
Description copied from interface:ISQLServerDataSource
Sets Constructor Arguments to be provided on constructor of 'trustManagerClass'.- Specified by:
setTrustManagerConstructorArg
in interfaceISQLServerDataSource
- Parameters:
trustManagerConstructorArg
- 'trustManagerClass' constructor arguments
-
getTrustManagerConstructorArg
Description copied from interface:ISQLServerDataSource
Returns the value for the connection property 'trustManagerConstructorArg'.- Specified by:
getTrustManagerConstructorArg
in interfaceISQLServerDataSource
- Returns:
- trustManagerConstructorArg property value
-
setURL
Sets the datasource URL.- Specified by:
setURL
in interfaceISQLServerDataSource
- Parameters:
url
- The URL property is exposed for backwards compatibility reasons. Also, several Java Application servers expect a setURL function on the DataSource and set it by default (JBoss and WebLogic) Note for security reasons we do not recommend that customers include the password in the url supplied to setURL. The reason for this is third-party Java Application Servers will very often display the value set to URL property in their DataSource configuration GUI. We recommend instead that clients use the setPassword method to set the password value. The Java Application Servers will not display a password that is set on the DataSource in the configuration GUI. Note if setURL is not called, getURL returns the default value of "jdbc:sqlserver://".
-
getURL
Description copied from interface:ISQLServerDataSource
Returns the URL that is used to connect to the data source.- Specified by:
getURL
in interfaceISQLServerDataSource
- Returns:
- A String that contains the URL.
-
setDescription
Sets the DataSource description. Per JDBC specification 16.1.1 "...the only property that all DataSource implementations are required to support is the description property".- Specified by:
setDescription
in interfaceISQLServerDataSource
- Parameters:
description
- A String that contains the description.
-
getDescription
Returns the DataSource description- Specified by:
getDescription
in interfaceISQLServerDataSource
- Returns:
- A String that contains the data source description or null if no value is set.
-
setPacketSize
public void setPacketSize(int packetSize) Sets the packet size.- Specified by:
setPacketSize
in interfaceISQLServerDataSource
- Parameters:
packetSize
- the size (in bytes) to use for the TCP/IP send and receive buffer. It is also the value used for the TDS packet size (SQL Server Network Packet Size). Validity of the value is checked at connect time. If no value is set for this property, its default value is 4KB.
-
getPacketSize
public int getPacketSize()Description copied from interface:ISQLServerDataSource
Returns the current network packet size used to communicate with SQL Server, specified in bytes.- Specified by:
getPacketSize
in interfaceISQLServerDataSource
- Returns:
- An int value containing the current network packet size.
-
setQueryTimeout
public void setQueryTimeout(int queryTimeout) Description copied from interface:ISQLServerDataSource
Setting the query timeout.- Specified by:
setQueryTimeout
in interfaceISQLServerDataSource
- Parameters:
queryTimeout
- The number of seconds to wait before a timeout has occurred on a query. The default value is 0, which means infinite timeout.
-
getQueryTimeout
public int getQueryTimeout()Description copied from interface:ISQLServerDataSource
Returns the query timeout.- Specified by:
getQueryTimeout
in interfaceISQLServerDataSource
- Returns:
- The number of seconds to wait before a timeout has occurred on a query.
-
setCancelQueryTimeout
public void setCancelQueryTimeout(int cancelQueryTimeout) Description copied from interface:ISQLServerDataSource
Sets the cancel timeout.- Specified by:
setCancelQueryTimeout
in interfaceISQLServerDataSource
- Parameters:
cancelQueryTimeout
- The number of seconds to wait before we wait for the query timeout to happen.
-
getCancelQueryTimeout
public int getCancelQueryTimeout()Description copied from interface:ISQLServerDataSource
Returns the cancel timeout.- Specified by:
getCancelQueryTimeout
in interfaceISQLServerDataSource
- Returns:
- the number of seconds to wait before we wait for the query timeout to happen.
-
setEnablePrepareOnFirstPreparedStatementCall
public void setEnablePrepareOnFirstPreparedStatementCall(boolean enablePrepareOnFirstPreparedStatementCall) Description copied from interface:ISQLServerDataSource
Sets the value that enables/disables whether the first execution of a prepared statement will call sp_executesql and not prepare a statement. If this configuration is false the first execution of a prepared statement will call sp_executesql and not prepare a statement, once the second execution happens it will call sp_prepexec and actually setup a prepared statement handle. Following executions will call sp_execute. This relieves the need for sp_unprepare on prepared statement close if the statement is only executed once.- Specified by:
setEnablePrepareOnFirstPreparedStatementCall
in interfaceISQLServerDataSource
- Parameters:
enablePrepareOnFirstPreparedStatementCall
- Changes the setting per the description.
-
getEnablePrepareOnFirstPreparedStatementCall
public boolean getEnablePrepareOnFirstPreparedStatementCall()Description copied from interface:ISQLServerDataSource
Returns the value that indicates whether the first execution of a prepared statement will call sp_executesql and not prepare a statement. If this configuration returns false the first execution of a prepared statement will call sp_executesql and not prepare a statement, once the second execution happens it will call sp_prepexec and actually setup a prepared statement handle. Following executions will call sp_execute. This relieves the need for sp_unprepare on prepared statement close if the statement is only executed once.- Specified by:
getEnablePrepareOnFirstPreparedStatementCall
in interfaceISQLServerDataSource
- Returns:
- Returns the current setting per the description.
-
setServerPreparedStatementDiscardThreshold
public void setServerPreparedStatementDiscardThreshold(int serverPreparedStatementDiscardThreshold) Description copied from interface:ISQLServerDataSource
Sets the value that controls how many outstanding prepared statement discard actions (sp_unprepare) can be outstanding per connection before a call to clean-up the outstanding handles on the server is executed. If the setting is <= 1 unprepare actions will be executed immedietely on prepared statement close. If it is set to > 1 these calls will be batched together to avoid overhead of calling sp_unprepare too often.- Specified by:
setServerPreparedStatementDiscardThreshold
in interfaceISQLServerDataSource
- Parameters:
serverPreparedStatementDiscardThreshold
- Changes the setting per the description.
-
getServerPreparedStatementDiscardThreshold
public int getServerPreparedStatementDiscardThreshold()Description copied from interface:ISQLServerDataSource
Returns the value of the setting that controls how many outstanding prepared statement discard actions (sp_unprepare) can be outstanding per connection before a call to clean-up the outstanding handles on the server is executed.- Specified by:
getServerPreparedStatementDiscardThreshold
in interfaceISQLServerDataSource
- Returns:
- Returns the current setting per the description.
-
setStatementPoolingCacheSize
public void setStatementPoolingCacheSize(int statementPoolingCacheSize) Description copied from interface:ISQLServerDataSource
Sets the size of the prepared statement cache for this connection. A value less than 1 means no cache.- Specified by:
setStatementPoolingCacheSize
in interfaceISQLServerDataSource
- Parameters:
statementPoolingCacheSize
- Changes the setting per the description.
-
getStatementPoolingCacheSize
public int getStatementPoolingCacheSize()Description copied from interface:ISQLServerDataSource
Returns the size of the prepared statement cache for this connection. A value less than 1 means no cache.- Specified by:
getStatementPoolingCacheSize
in interfaceISQLServerDataSource
- Returns:
- Returns the current setting per the description.
-
setDisableStatementPooling
public void setDisableStatementPooling(boolean disableStatementPooling) Description copied from interface:ISQLServerDataSource
Sets the value to disable/enable statement pooling.- Specified by:
setDisableStatementPooling
in interfaceISQLServerDataSource
- Parameters:
disableStatementPooling
- true to disable statement pooling, false to enable it.
-
getDisableStatementPooling
public boolean getDisableStatementPooling()Description copied from interface:ISQLServerDataSource
Returns whether statement pooling is disabled.- Specified by:
getDisableStatementPooling
in interfaceISQLServerDataSource
- Returns:
- true if statement pooling is disabled, false if it is enabled.
-
setSocketTimeout
public void setSocketTimeout(int socketTimeout) Description copied from interface:ISQLServerDataSource
Sets the socket timeout value.- Specified by:
setSocketTimeout
in interfaceISQLServerDataSource
- Parameters:
socketTimeout
- The number of milliseconds to wait before a timeout is occurred on a socket read or accept. The default value is 0, which means infinite timeout.
-
getSocketTimeout
public int getSocketTimeout()Description copied from interface:ISQLServerDataSource
Returns the socket timeout value.- Specified by:
getSocketTimeout
in interfaceISQLServerDataSource
- Returns:
- The number of milliseconds to wait before a timeout is occurred on a socket read or accept.
-
setUseBulkCopyForBatchInsert
public void setUseBulkCopyForBatchInsert(boolean useBulkCopyForBatchInsert) Description copied from interface:ISQLServerDataSource
Sets whether the use Bulk Copy API should be used for Batch Insert.- Specified by:
setUseBulkCopyForBatchInsert
in interfaceISQLServerDataSource
- Parameters:
useBulkCopyForBatchInsert
- indicates whether Bulk Copy API should be used for Batch Insert operations.
-
getUseBulkCopyForBatchInsert
public boolean getUseBulkCopyForBatchInsert()Description copied from interface:ISQLServerDataSource
Returns whether the use Bulk Copy API is used for Batch Insert.- Specified by:
getUseBulkCopyForBatchInsert
in interfaceISQLServerDataSource
- Returns:
- whether the driver should use Bulk Copy API for Batch Insert operations.
-
setJASSConfigurationName
Deprecated.Description copied from interface:ISQLServerDataSource
Sets the login configuration file for Kerberos authentication. This overrides the default configuration SQLJDBCDriver- Specified by:
setJASSConfigurationName
in interfaceISQLServerDataSource
- Parameters:
configurationName
- the configuration name
-
getJASSConfigurationName
Deprecated.Description copied from interface:ISQLServerDataSource
Returns the login configuration file for Kerberos authentication.- Specified by:
getJASSConfigurationName
in interfaceISQLServerDataSource
- Returns:
- login configuration file name
-
setJAASConfigurationName
Description copied from interface:ISQLServerDataSource
Sets the login configuration file for Kerberos authentication. This overrides the default configuration SQLJDBCDriver- Specified by:
setJAASConfigurationName
in interfaceISQLServerDataSource
- Parameters:
configurationName
- the configuration name
-
getJAASConfigurationName
Description copied from interface:ISQLServerDataSource
Returns the login configuration file for Kerberos authentication.- Specified by:
getJAASConfigurationName
in interfaceISQLServerDataSource
- Returns:
- login configuration file name
-
setMSIClientId
Description copied from interface:ISQLServerDataSource
Sets the client id to be used to retrieve access token from MSI EndPoint.- Specified by:
setMSIClientId
in interfaceISQLServerDataSource
- Parameters:
msiClientId
- Client ID of User Assigned Managed Identity
-
getMSIClientId
Description copied from interface:ISQLServerDataSource
Returns the value for the connection property 'msiClientId'.- Specified by:
getMSIClientId
in interfaceISQLServerDataSource
- Returns:
- msiClientId property value
-
setKeyVaultProviderClientId
Description copied from interface:ISQLServerDataSource
Sets the Azure Key Vault (AKV) Provider Client Id to provided value to be used for column encryption.- Specified by:
setKeyVaultProviderClientId
in interfaceISQLServerDataSource
- Parameters:
keyVaultProviderClientId
- Client Id of Azure Key Vault (AKV) Provider to be used for column encryption.
-
getKeyVaultProviderClientId
Description copied from interface:ISQLServerDataSource
Returns the value for the connection property 'keyVaultProviderClientId'.- Specified by:
getKeyVaultProviderClientId
in interfaceISQLServerDataSource
- Returns:
- keyVaultProviderClientId
-
setKeyVaultProviderClientKey
Description copied from interface:ISQLServerDataSource
Sets the Azure Key Vault (AKV) Provider Client Key to provided value to be used for column encryption.- Specified by:
setKeyVaultProviderClientKey
in interfaceISQLServerDataSource
- Parameters:
keyVaultProviderClientKey
- Client Key of Azure Key Vault (AKV) Provider to be used for column encryption.
-
setKeyStorePrincipalId
Description copied from interface:ISQLServerDataSource
Sets the value for the connection property 'keyStorePrincipalId'.- Specified by:
setKeyStorePrincipalId
in interfaceISQLServerDataSource
- Parameters:
keyStorePrincipalId
-When keyStoreAuthentication = keyVaultClientSecret, set this value to a valid Azure Active Directory Application Client ID. When keyStoreAuthentication = keyVaultManagedIdentity, set this value to a valid Azure Active Directory Application Object ID (optional, for user-assigned only).
-
getKeyStorePrincipalId
Description copied from interface:ISQLServerDataSource
Returns the value for the connection property 'keyStorePrincipalId'.- Specified by:
getKeyStorePrincipalId
in interfaceISQLServerDataSource
- Returns:
- keyStorePrincipalId
-
getDomain
Description copied from interface:ISQLServerDataSource
Returns the value for the connection property 'domain'.- Specified by:
getDomain
in interfaceISQLServerDataSource
- Returns:
- 'domain' property value
-
setDomain
Description copied from interface:ISQLServerDataSource
Sets the 'domain' connection property used for NTLM Authentication.- Specified by:
setDomain
in interfaceISQLServerDataSource
- Parameters:
domain
- Windows domain name
-
getEnclaveAttestationUrl
Description copied from interface:ISQLServerDataSource
Returns the enclave attestation URL used in Always Encrypted with Secure Enclaves.- Specified by:
getEnclaveAttestationUrl
in interfaceISQLServerDataSource
- Returns:
- enclave attestation URL.
-
setEnclaveAttestationUrl
Description copied from interface:ISQLServerDataSource
Sets the enclave attestation URL used in Always Encrypted with Secure Enclaves.- Specified by:
setEnclaveAttestationUrl
in interfaceISQLServerDataSource
- Parameters:
url
- Enclave attestation URL.
-
getEnclaveAttestationProtocol
Description copied from interface:ISQLServerDataSource
Returns the enclave attestation protocol used in Always Encrypted with Secure Enclaves.- Specified by:
getEnclaveAttestationProtocol
in interfaceISQLServerDataSource
- Returns:
- Enclave attestation protocol.
-
setEnclaveAttestationProtocol
Description copied from interface:ISQLServerDataSource
Sets the enclave attestation protocol to be used in Always Encrypted with Secure Enclaves.- Specified by:
setEnclaveAttestationProtocol
in interfaceISQLServerDataSource
- Parameters:
protocol
- Enclave attestation protocol.
-
getClientCertificate
Description copied from interface:ISQLServerDataSource
Returns client certificate path for client certificate authentication.- Specified by:
getClientCertificate
in interfaceISQLServerDataSource
- Returns:
- Client certificate path.
-
setClientCertificate
Description copied from interface:ISQLServerDataSource
Sets client certificate path for client certificate authentication.- Specified by:
setClientCertificate
in interfaceISQLServerDataSource
- Parameters:
certPath
- Client certificate path.
-
getClientKey
Description copied from interface:ISQLServerDataSource
Returns Private key file path for client certificate authentication.- Specified by:
getClientKey
in interfaceISQLServerDataSource
- Returns:
- Private key file path.
-
setClientKey
Description copied from interface:ISQLServerDataSource
Sets Private key file path for client certificate authentication.- Specified by:
setClientKey
in interfaceISQLServerDataSource
- Parameters:
keyPath
- Private key file path.
-
setClientKeyPassword
Description copied from interface:ISQLServerDataSource
Sets the password to be used for Private key provided by the user for client certificate authentication.- Specified by:
setClientKeyPassword
in interfaceISQLServerDataSource
- Parameters:
password
- Private key password.
-
getAADSecurePrincipalId
Deprecated.Description copied from interface:ISQLServerDataSource
Returns the value for the connection property 'AADSecurePrincipalId'.- Specified by:
getAADSecurePrincipalId
in interfaceISQLServerDataSource
- Returns:
- 'AADSecurePrincipalId' property value.
-
setAADSecurePrincipalId
Deprecated.Description copied from interface:ISQLServerDataSource
Sets the 'AADSecurePrincipalId' connection property used for Active Directory Service Principal authentication.- Specified by:
setAADSecurePrincipalId
in interfaceISQLServerDataSource
- Parameters:
AADSecurePrincipalId
- Active Directory Service Principal Id.
-
setAADSecurePrincipalSecret
Deprecated.Description copied from interface:ISQLServerDataSource
Sets the 'AADSecurePrincipalSecret' connection property used for Active Directory Service Principal authentication.- Specified by:
setAADSecurePrincipalSecret
in interfaceISQLServerDataSource
- Parameters:
AADSecurePrincipalSecret
- Active Directory Service Principal secret.
-
getSendTemporalDataTypesAsStringForBulkCopy
public boolean getSendTemporalDataTypesAsStringForBulkCopy()Description copied from interface:ISQLServerDataSource
Returns the current flag for value sendTemporalDataTypesAsStringForBulkCopy- Specified by:
getSendTemporalDataTypesAsStringForBulkCopy
in interfaceISQLServerDataSource
- Returns:
- 'sendTemporalDataTypesAsStringForBulkCopy' property value.
-
setSendTemporalDataTypesAsStringForBulkCopy
public void setSendTemporalDataTypesAsStringForBulkCopy(boolean sendTemporalDataTypesAsStringForBulkCopy) Description copied from interface:ISQLServerDataSource
Specifies the flag to send temporal datatypes as String for Bulk Copy.- Specified by:
setSendTemporalDataTypesAsStringForBulkCopy
in interfaceISQLServerDataSource
- Parameters:
sendTemporalDataTypesAsStringForBulkCopy
- boolean value for 'sendTemporalDataTypesAsStringForBulkCopy'.
-
getMaxResultBuffer
Description copied from interface:ISQLServerDataSource
Returns value of 'maxResultBuffer' from Connection String.- Specified by:
getMaxResultBuffer
in interfaceISQLServerDataSource
- Returns:
- 'maxResultBuffer' property.
-
setMaxResultBuffer
Description copied from interface:ISQLServerDataSource
Sets the value for 'maxResultBuffer' property- Specified by:
setMaxResultBuffer
in interfaceISQLServerDataSource
- Parameters:
maxResultBuffer
- String value for 'maxResultBuffer'
-
setConnectRetryCount
public void setConnectRetryCount(int count) Description copied from interface:ISQLServerDataSource
Sets the maximum number of attempts to reestablish a broken connection.- Specified by:
setConnectRetryCount
in interfaceISQLServerDataSource
- Parameters:
count
- maximum number of attempts
-
getConnectRetryCount
public int getConnectRetryCount()Description copied from interface:ISQLServerDataSource
Returns the maximum number of attempts set to reestablish a broken connection.- Specified by:
getConnectRetryCount
in interfaceISQLServerDataSource
- Returns:
- maximum number of attempts
-
setConnectRetryInterval
public void setConnectRetryInterval(int interval) Description copied from interface:ISQLServerDataSource
Sets the interval, in seconds, between attempts to reestablish a broken connection.- Specified by:
setConnectRetryInterval
in interfaceISQLServerDataSource
- Parameters:
interval
- interval in seconds
-
getConnectRetryInterval
public int getConnectRetryInterval()Description copied from interface:ISQLServerDataSource
Returns the interval set, in seconds, between attempts to reestablish a broken connection.- Specified by:
getConnectRetryInterval
in interfaceISQLServerDataSource
- Returns:
- interval in seconds
-
setPrepareMethod
Description copied from interface:ISQLServerDataSource
Sets the behavior for the prepare method.PrepareMethod
- Specified by:
setPrepareMethod
in interfaceISQLServerDataSource
- Parameters:
prepareMethod
- Changes the setting as per description
-
getPrepareMethod
Description copied from interface:ISQLServerDataSource
Returns the value indicating the prepare method.PrepareMethod
- Specified by:
getPrepareMethod
in interfaceISQLServerDataSource
- Returns:
- prepare method
-
setMsiTokenCacheTtl
public void setMsiTokenCacheTtl(int timeToLive) Description copied from interface:ISQLServerDataSource
Sets time-to-live for the the cached MSI token- Specified by:
setMsiTokenCacheTtl
in interfaceISQLServerDataSource
- Parameters:
timeToLive
- Changes the setting as per description
-
getMsiTokenCacheTtl
public int getMsiTokenCacheTtl()Description copied from interface:ISQLServerDataSource
Gets the time-to-live for the the cached MSI token- Specified by:
getMsiTokenCacheTtl
in interfaceISQLServerDataSource
- Returns:
- time-to-live for the cached MSI token
-
getReference
- Specified by:
getReference
in interfaceReferenceable
-
isWrapperFor
- Specified by:
isWrapperFor
in interfaceWrapper
- Throws:
SQLException
-
unwrap
- Specified by:
unwrap
in interfaceWrapper
- Throws:
SQLException
-