SQLServerDataSource Class
- java.
lang. Object - com.
microsoft. sqlserver. jdbc. SQLServerDataSource
- com.
Implements
public class SQLServerDataSource
implements ISQLServerDataSource, javax.sql.DataSource, java.io.Serializable, javax.naming.Referenceable
Contains a list of properties specific for the SQLServerConnection class.
Constructor Summary
| Constructor | Description |
|---|---|
| SQLServerDataSource() |
Constructs a SQLServer |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| T | unwrap(Class<T> iface) |
| java.lang.String |
getAADSecurePrincipalId()
Deprecated Returns the value for the connection property 'AADSecure |
| java.lang.String |
getAccessToken()
Returns the access token. |
|
SQLServer |
getAccessTokenCallback()
Returns a SQLServerAccessTokenCallback, the access token callback delegate. |
| java.lang.String |
getAccessTokenCallbackClass()
Returns the fully qualified class name of the implementing class for SQLServerAccessTokenCallback. |
| java.lang.String |
getApplicationIntent()
Returns the application intent. |
| java.lang.String |
getApplicationName()
Returns the application name. |
| java.lang.String |
getAuthentication()
Returns the authentication mode. |
| boolean |
getCalcBigDecimalPrecision()
Returns the value for 'calc |
| int |
getCancelQueryTimeout()
Returns the cancel timeout. |
| java.lang.String |
getClientCertificate()
Returns client certificate path for client certificate authentication. |
| java.lang.String |
getClientKey()
Returns Private key file path for client certificate authentication. |
| java.lang.String |
getColumnEncryptionSetting()
Returns the Always Encrypted functionality setting for the data source object. |
| int |
getConnectRetryCount()
Returns the maximum number of attempts set to reestablish a broken connection. |
| int |
getConnectRetryInterval()
Returns the interval set, in seconds, between attempts to reestablish a broken connection. |
| java.sql.Connection | getConnection() |
| java.sql.Connection | getConnection(String username, String password) |
| java.lang.String |
getDatabaseName()
Returns the database name. |
| java.lang.String |
getDatetimeParameterType()
Returns the value of the datetime |
| boolean |
getDelayLoadingLobs()
Returns the current flag value for delay |
| java.lang.String |
getDescription()
Returns the Data |
| boolean |
getDisableStatementPooling()
Returns whether statement pooling is disabled. |
| java.lang.String |
getDomain()
Returns the value for the connection property 'domain'. |
| boolean |
getEnablePrepareOnFirstPreparedStatementCall()
Returns the value that indicates whether the first execution of a prepared statement will call sp_executesql and not prepare a statement. |
| java.lang.String |
getEnclaveAttestationProtocol()
Returns the enclave attestation protocol used in Always Encrypted with Secure Enclaves. |
| java.lang.String |
getEnclaveAttestationUrl()
Returns the enclave attestation URL used in Always Encrypted with Secure Enclaves. |
| java.lang.String |
getEncrypt()
Returns the TLS encryption option. |
| boolean |
getFIPS()
Returns the value of connection property "fips". |
| java.lang.String |
getFailoverPartner()
Returns the name of the failover server that is used in a database mirroring configuration. |
| org.ietf.jgss.GSSCredential |
getGSSCredentials()
Returns the GSSCredential. |
| java.lang.String |
getHostNameInCertificate()
Returns the host name used in validating the SQL Server Secure Sockets Layer (SSL) certificate. |
| java.lang.String |
getIPAddressPreference()
Gets the preferred type of IP Address |
| java.lang.String |
getInstanceName()
Returns the SQL Server instance name. |
| java.lang.String |
getJAASConfigurationName()
Returns the login configuration name for Kerberos authentication. |
| java.lang.String |
getJASSConfigurationName()
Deprecated Returns the login configuration name for Kerberos authentication. |
| java.lang.String |
getKeyStoreAuthentication()
Returns the value of the key |
| java.lang.String |
getKeyStoreLocation()
Returns the key |
| java.lang.String |
getKeyStorePrincipalId()
Returns the value for the connection property 'key |
| java.lang.String |
getKeyVaultProviderClientId()
Returns the value for the connection property 'key |
| boolean |
getLastUpdateCount()
Returns a Boolean value that indicates if the last |
| int |
getLockTimeout()
Returns an int value that indicates the number of milliseconds that the database will wait before reporting a lock time out. |
| java.io.PrintWriter |
getLogWriter()
Returns the log writer for this Data |
| int | getLoginTimeout() |
| java.lang.String |
getMSIClientId()
Deprecated
This method is deprecated. Use getUser() instead. Returns the value for the connection property 'msi
Returns the value for the connection property 'msi |
| java.lang.String |
getMaxResultBuffer()
Returns value of 'max |
| int |
getMsiTokenCacheTtl()
Deprecated
Time-to-live is no longer supported for the cached Managed Identity tokens. This method is a no-op for backwards compatibility only.
Time-to-live is no longer supported for the cached Managed Identity tokens. |
| boolean |
getMultiSubnetFailover()
Returns the value of the multi |
| int |
getPacketSize()
Returns the current network packet size used to communicate with SQL Server, specified in bytes. |
| java.util.logging.Logger | getParentLogger() |
| int |
getPortNumber()
Returns the current port number that is used to communicate with SQL Server. |
| java.lang.String |
getPrepareMethod()
Returns the value indicating the prepare method. |
| int |
getQueryTimeout()
Returns the query timeout. |
| java.lang.String |
getRealm()
Returns the realm for Kerberos authentication. |
| javax.naming.Reference | getReference() |
| boolean |
getReplication()
Returns the value of the replication connection property. |
| java.lang.String |
getResponseBuffering()
Returns the response buffering mode for this SQLServer |
| java.lang.String |
getSSLProtocol()
Returns the value of connection property 'ssl |
| java.lang.String |
getSelectMethod()
Returns the default cursor type used for all result sets that are created by using this SQLServer |
| boolean |
getSendStringParametersAsUnicode()
Returns whether sending string parameters to the server in UNICODE format is enabled. |
| boolean |
getSendTemporalDataTypesAsStringForBulkCopy()
Returns the current flag for value send |
| boolean |
getSendTimeAsDatetime()
Returns the value of the send |
| java.lang.String |
getServerCertificate()
Returns the path to the server certificate. |
| java.lang.String |
getServerName()
Returns the name of the SQL Server instance. |
| boolean |
getServerNameAsACE()
Returns if the server |
| int |
getServerPreparedStatementDiscardThreshold()
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. |
| java.lang.String |
getServerSpn()
Returns the server spn. |
| java.lang.String |
getSocketFactoryClass()
Returns the value for the connection property 'socket |
| java.lang.String |
getSocketFactoryConstructorArg()
Returns the value for the connection property 'socket |
| int |
getSocketTimeout()
Returns the socket timeout value. |
| int |
getStatementPoolingCacheSize()
Returns the size of the prepared statement cache for this connection. |
| boolean |
getTransparentNetworkIPResolution()
Returns the Transparent |
| java.lang.String |
getTrustManagerClass()
Returns the value for the connection property 'trust |
| java.lang.String |
getTrustManagerConstructorArg()
Returns the value for the connection property 'trust |
| boolean |
getTrustServerCertificate()
Returns a boolean value that indicates if the trust |
| java.lang.String |
getTrustStore()
Returns the path (including file name) to the certificate trust |
| java.lang.String |
getTrustStoreType()
Returns the key |
| java.lang.String |
getURL()
Returns the URL that is used to connect to the data source. |
| boolean |
getUseBulkCopyForBatchInsert()
Returns whether the use Bulk Copy API is used for Batch Insert. |
| boolean |
getUseDefaultGSSCredential()
Returns the use |
| boolean |
getUseDefaultJaasConfig()
Returns whether the default JAAS Configuration should be used |
| boolean |
getUseFlexibleCallableStatements()
Returns whether or not sp_sproc_columns is being used for parameter name lookup. |
| boolean |
getUseFmtOnly()
Returns the current flag value for use |
| java.lang.String |
getUser()
Returns the user name that is used to connect the data source. |
| java.lang.String |
getWorkstationID()
Returns the name of the client computer name that is used to connect to the data source. |
| boolean |
getXopenStates()
Returns the value that indicates if converting SQL states to XOPEN compliant states is enabled. |
| boolean |
getcacheBulkCopyMetadata()
Sets the value for 'cache |
| boolean | isWrapperFor(Class<?> iface) |
| void |
setAADSecurePrincipalId(String aadSecurePrincipalId)
Deprecated Sets the 'AADSecure |
| void |
setAADSecurePrincipalSecret(String aadSecurePrincipalSecret)
Deprecated Sets the 'AADSecure |
| void |
setAccessToken(String accessToken)
Sets the access token. |
| void |
setAccessTokenCallback(SQLServerAccessTokenCallback accessTokenCallback)
Sets the SQLServerAccessTokenCallback delegate. |
| void |
setAccessTokenCallbackClass(String accessTokenCallbackClass)
Sets 'access |
| 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 |
setCalcBigDecimalPrecision(boolean calcBigDecimalPrecision)
Sets the 'calc |
| 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 |
setDatetimeParameterType(String datetimeParameterType)
Sets the SQL server datatype to use for Java datetime and timestamp values. |
| void |
setDelayLoadingLobs(boolean delayLoadingLobs)
Specifies the flag to load LOBs instead of streaming them. |
| void |
setDescription(String description)
Sets the Data |
| void |
setDisableStatementPooling(boolean disableStatementPooling)
Sets the value to disable/enable statement pooling. |
| void |
setDomain(String domain)
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 |
setEnclaveAttestationUrl(String url)
Sets the enclave attestation URL used in Always Encrypted with Secure Enclaves. |
| void |
setEncrypt(boolean encryptOption)
Deprecated Sets the option whether TLS encryption is used. |
| void |
setEncrypt(String encryptOption)
Sets the option whether TLS encryption is used. |
| void |
setFIPS(boolean fips)
Sets whether Fips Mode should be enabled/disabled on the connection. |
| void |
setFailoverPartner(String serverName)
Sets the fail over partner of the target SQL Server. |
| 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 |
setIPAddressPreference(String iPAddressPreference)
Set the preferred type of IP Address |
| 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 integrated |
| void |
setJAASConfigurationName(String configurationName)
Sets the login configuration name for Kerberos authentication. |
| void |
setJASSConfigurationName(String configurationName)
Deprecated Sets the login configuration name for Kerberos authentication. |
| 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 'key |
| 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 last |
| void |
setLockTimeout(int lockTimeout)
Sets the lock timeout value. |
| void | setLogWriter(PrintWriter out) |
| void |
setLoginTimeout(int loginTimeout)
Sets the maximum time in seconds that this data source will wait while attempting to connect to a database. |
| void |
setMSIClientId(String managedIdentityClientId)
Deprecated
This method is deprecated. Use setUser(String user) instead. Sets the client id to be used to retrieve the access token for a user-assigned Managed Identity.
Sets the client id to be used to retrieve the access token for a user-assigned Managed Identity. |
| void |
setMaxResultBuffer(String maxResultBuffer)
Sets the value for 'max |
| void |
setMsiTokenCacheTtl(int timeToLive)
Deprecated
Time-to-live is no longer supported for the cached Managed Identity tokens. This method will always return 0 and is for backwards compatibility only.
Time-to-live is no longer supported for the cached Managed Identity tokens. |
| void |
setMultiSubnetFailover(boolean multiSubnetFailover)
Sets the value of the multi |
| 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 |
setRealm(String realm)
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 SQLServer |
| void |
setSSLProtocol(String sslProtocol)
Sets the ssl |
| 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 send |
| void |
setServerCertificate(String cert)
Sets the connection property 'server |
| void |
setServerName(String serverName)
Sets the host name of the target SQL Server. |
| void |
setServerNameAsACE(boolean serverNameAsACE)
Sets whether the server |
| 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 'socket |
| void |
setSocketFactoryConstructorArg(String socketFactoryConstructorArg)
Sets Constructor Arguments to be provided on constructor of 'socket |
| void |
setSocketTimeout(int socketTimeout)
Sets the socket timeout value. |
| 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 'trust |
| void |
setTrustManagerConstructorArg(String trustManagerConstructorArg)
Sets Constructor Arguments to be provided on constructor of 'trust |
| void |
setTrustServerCertificate(boolean e)
Sets a boolean value that indicates if the trust |
| void |
setTrustStore(String trustStore)
Sets the path (including file name) to the certificate trust |
| void |
setTrustStorePassword(String trustStorePassword)
Sets the password that is used to check the integrity of the trust |
| void |
setTrustStoreType(String trustStoreType)
Sets the keystore type for the trust |
| void |
setURL(String url)
Sets the datasource URL. |
| void |
setUseBulkCopyForBatchInsert(boolean useBulkCopyForBatchInsert)
Sets whether the use Bulk Copy API should be used for Batch Insert. |
| void |
setUseDefaultGSSCredential(boolean enable)
Sets the value to indicate whether use |
| void |
setUseDefaultJaasConfig(boolean useDefaultJaasConfig)
Sets whether the default JAAS Configuration will be used. |
| void |
setUseFlexibleCallableStatements(boolean enable)
Sets whether or not sp_sproc_columns will be used for parameter name lookup. |
| void |
setUseFmtOnly(boolean useFmtOnly)
Specifies the flag to use FMTONLY for parameter metadata queries. |
| void |
setUser(String user)
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. |
| void |
setcacheBulkCopyMetadata(boolean cacheBulkCopyMetadata)
Returns value of 'cache |
| java.lang.String | toString() |
Methods inherited from java.lang.Object
Constructor Details
SQLServerDataSource
public SQLServerDataSource()
Constructs a SQLServerDataSource.
Method Details
unwrap
public T <T>unwrap(Class<T> iface)
Parameters:
Throws:
getAADSecurePrincipalId
(=9.4.1,=true)
public String getAADSecurePrincipalId()
Deprecated
Returns the value for the connection property 'AADSecurePrincipalId'.
getAccessToken
public String getAccessToken()
Returns the access token.
getAccessTokenCallback
public SQLServerAccessTokenCallback getAccessTokenCallback()
Returns a SQLServerAccessTokenCallback, the access token callback delegate.
Returns:
getAccessTokenCallbackClass
public String getAccessTokenCallbackClass()
Returns the fully qualified class name of the implementing class for SQLServerAccessTokenCallback.
Returns:
getApplicationIntent
public String getApplicationIntent()
Returns the application intent.
getApplicationName
public String getApplicationName()
Returns the application name.
getAuthentication
public String getAuthentication()
Returns the authentication mode.
getCalcBigDecimalPrecision
public boolean getCalcBigDecimalPrecision()
Returns the value for 'calcBigDecimalPrecision'.
Returns:
getCancelQueryTimeout
public int getCancelQueryTimeout()
Returns the cancel timeout.
getClientCertificate
public String getClientCertificate()
Returns client certificate path for client certificate authentication.
getClientKey
public String getClientKey()
Returns Private key file path for client certificate authentication.
getColumnEncryptionSetting
public String getColumnEncryptionSetting()
Returns the Always Encrypted functionality setting for the data source object.
getConnectRetryCount
public int getConnectRetryCount()
Returns the maximum number of attempts set to reestablish a broken connection.
getConnectRetryInterval
public int getConnectRetryInterval()
Returns the interval set, in seconds, between attempts to reestablish a broken connection.
getConnection
getConnection
public Connection getConnection(String username, String password)
Parameters:
Throws:
getDatabaseName
public String getDatabaseName()
Returns the database name.
getDatetimeParameterType
public String getDatetimeParameterType()
Returns the value of the datetimeParameterType connection property. This method was added in SQL Server JDBC Driver 12.2. Returns the setting of the datetimeParameterType connection property.
getDelayLoadingLobs
public boolean getDelayLoadingLobs()
Returns the current flag value for delayLoadingLobs.
getDescription
public String getDescription()
Returns the DataSource description
getDisableStatementPooling
public boolean getDisableStatementPooling()
Returns whether statement pooling is disabled.
getDomain
public String getDomain()
Returns the value for the connection property 'domain'.
getEnablePrepareOnFirstPreparedStatementCall
public boolean getEnablePrepareOnFirstPreparedStatementCall()
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.
getEnclaveAttestationProtocol
public String getEnclaveAttestationProtocol()
Returns the enclave attestation protocol used in Always Encrypted with Secure Enclaves.
getEnclaveAttestationUrl
public String getEnclaveAttestationUrl()
Returns the enclave attestation URL used in Always Encrypted with Secure Enclaves.
getEncrypt
public String getEncrypt()
Returns the TLS encryption option.
getFIPS
public boolean getFIPS()
Returns the value of connection property "fips". For FIPS enabled JVM this property should be true.
getFailoverPartner
public String getFailoverPartner()
Returns the name of the failover server that is used in a database mirroring configuration.
getGSSCredentials
public GSSCredential getGSSCredentials()
Returns the GSSCredential.
getHostNameInCertificate
public String getHostNameInCertificate()
Returns the host name used in validating the SQL Server Secure Sockets Layer (SSL) certificate.
getIPAddressPreference
public String getIPAddressPreference()
Gets the preferred type of IP Address
getInstanceName
public String getInstanceName()
Returns the SQL Server instance name.
getJAASConfigurationName
public String getJAASConfigurationName()
Returns the login configuration name for Kerberos authentication.
getJASSConfigurationName
(=9.3.0,=true)
public String getJASSConfigurationName()
Deprecated
Returns the login configuration name for Kerberos authentication.
getKeyStoreAuthentication
public String getKeyStoreAuthentication()
Returns the value of the keyStoreAuthentication setting for the data source object.
getKeyStoreLocation
public String getKeyStoreLocation()
Returns the keyStoreLocation for the Java Key Store.
getKeyStorePrincipalId
public String getKeyStorePrincipalId()
Returns the value for the connection property 'keyStorePrincipalId'.
getKeyVaultProviderClientId
public String getKeyVaultProviderClientId()
Returns the value for the connection property 'keyVaultProviderClientId'.
getLastUpdateCount
public boolean getLastUpdateCount()
Returns a Boolean value that indicates if the lastUpdateCount property is enabled.
getLockTimeout
public int getLockTimeout()
Returns an int value that indicates the number of milliseconds that the database will wait before reporting a lock time out.
getLogWriter
public PrintWriter getLogWriter()
Returns the log writer for this DataSource.
getLoginTimeout
public int getLoginTimeout()
getMSIClientId
(=12.1.0,=true)
public String getMSIClientId()
Deprecated
Returns the value for the connection property 'msiClientId'.
Returns:
getMaxResultBuffer
public String getMaxResultBuffer()
Returns value of 'maxResultBuffer' from Connection String.
getMsiTokenCacheTtl
(=12.1.0,=true)
public int getMsiTokenCacheTtl()
Deprecated
Time-to-live is no longer supported for the cached Managed Identity tokens. This method will always return 0 and is for backwards compatibility only.
getMultiSubnetFailover
public boolean getMultiSubnetFailover()
Returns the value of the multiSubnetFailover connection property.
getPacketSize
public int getPacketSize()
Returns the current network packet size used to communicate with SQL Server, specified in bytes.
getParentLogger
public Logger getParentLogger()
Throws:
getPortNumber
public int getPortNumber()
Returns the current port number that is used to communicate with SQL Server.
getPrepareMethod
public String getPrepareMethod()
Returns the value indicating the prepare method. PrepareMethod
getQueryTimeout
public int getQueryTimeout()
Returns the query timeout.
getRealm
public String getRealm()
Returns the realm for Kerberos authentication.
getReference
public Reference getReference()
getReplication
public boolean getReplication()
Returns the value of the replication connection property.
getResponseBuffering
public String getResponseBuffering()
Returns the response buffering mode for this SQLServerDataSource object.
getSSLProtocol
public String getSSLProtocol()
Returns the value of connection property 'sslProtocol'.
getSelectMethod
public String getSelectMethod()
Returns the default cursor type used for all result sets that are created by using this SQLServerDataSource object.
getSendStringParametersAsUnicode
public boolean getSendStringParametersAsUnicode()
Returns whether sending string parameters to the server in UNICODE format is enabled.
getSendTemporalDataTypesAsStringForBulkCopy
public boolean getSendTemporalDataTypesAsStringForBulkCopy()
Returns the current flag for value sendTemporalDataTypesAsStringForBulkCopy
getSendTimeAsDatetime
public boolean getSendTimeAsDatetime()
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.
getServerCertificate
public String getServerCertificate()
Returns the path to the server certificate.
getServerName
public String getServerName()
Returns the name of the SQL Server instance.
getServerNameAsACE
public boolean getServerNameAsACE()
Returns if the serverName should be translated from Unicode to ASCII Compatible Encoding (ACE).
getServerPreparedStatementDiscardThreshold
public int getServerPreparedStatementDiscardThreshold()
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.
getServerSpn
public String getServerSpn()
Returns the server spn.
getSocketFactoryClass
public String getSocketFactoryClass()
Returns the value for the connection property 'socketFactoryClass'.
getSocketFactoryConstructorArg
public String getSocketFactoryConstructorArg()
Returns the value for the connection property 'socketFactoryConstructorArg'.
getSocketTimeout
public int getSocketTimeout()
Returns the socket timeout value.
getStatementPoolingCacheSize
public int getStatementPoolingCacheSize()
Returns the size of the prepared statement cache for this connection. A value less than 1 means no cache.
getTransparentNetworkIPResolution
public boolean getTransparentNetworkIPResolution()
Returns the TransparentNetworkIPResolution value.
getTrustManagerClass
public String getTrustManagerClass()
Returns the value for the connection property 'trustManagerClass'.
getTrustManagerConstructorArg
public String getTrustManagerConstructorArg()
Returns the value for the connection property 'trustManagerConstructorArg'.
getTrustServerCertificate
public boolean getTrustServerCertificate()
Returns a boolean value that indicates if the trustServerCertificate property is enabled.
getTrustStore
public String getTrustStore()
Returns the path (including file name) to the certificate trustStore file.
getTrustStoreType
public String getTrustStoreType()
Returns the keyStore Type for the trustStore.
getURL
public String getURL()
Returns the URL that is used to connect to the data source.
getUseBulkCopyForBatchInsert
public boolean getUseBulkCopyForBatchInsert()
Returns whether the use Bulk Copy API is used for Batch Insert.
getUseDefaultGSSCredential
public boolean getUseDefaultGSSCredential()
Returns the useDefaultGSSCredential.
getUseDefaultJaasConfig
public boolean getUseDefaultJaasConfig()
Returns whether the default JAAS Configuration should be used
getUseFlexibleCallableStatements
public boolean getUseFlexibleCallableStatements()
Returns whether or not sp_sproc_columns is being used for parameter name lookup.
getUseFmtOnly
public boolean getUseFmtOnly()
Returns the current flag value for useFmtOnly.
getUser
public String getUser()
Returns the user name that is used to connect the data source.
getWorkstationID
public String getWorkstationID()
Returns the name of the client computer name that is used to connect to the data source.
getXopenStates
public boolean getXopenStates()
Returns the value that indicates if converting SQL states to XOPEN compliant states is enabled.
getcacheBulkCopyMetadata
public boolean getcacheBulkCopyMetadata()
Sets the value for 'cacheBulkCopyMetadata' property
isWrapperFor
public boolean isWrapperFor(Class<?> iface)
Parameters:
Throws:
setAADSecurePrincipalId
(=9.4.1,=true)
public void setAADSecurePrincipalId(String aadSecurePrincipalId)
Deprecated
Sets the 'AADSecurePrincipalId' connection property used for Active Directory Service Principal authentication.
Parameters:
setAADSecurePrincipalSecret
(=9.4.1,=true)
public void setAADSecurePrincipalSecret(String aadSecurePrincipalSecret)
Deprecated
Sets the 'AADSecurePrincipalSecret' connection property used for Active Directory Service Principal authentication.
Parameters:
setAccessToken
public void setAccessToken(String accessToken)
Sets the access token.
Parameters:
setAccessTokenCallback
public void setAccessTokenCallback(SQLServerAccessTokenCallback accessTokenCallback)
Sets the SQLServerAccessTokenCallback delegate.
Parameters:
setAccessTokenCallbackClass
public void setAccessTokenCallbackClass(String accessTokenCallbackClass)
Sets 'accessTokenCallbackClass' to the fully qualified class name of the implementing class for SQLServerAccessTokenCallback.
Parameters:
setApplicationIntent
public void setApplicationIntent(String applicationIntent)
Sets the application intent.
Parameters:
setApplicationName
public void setApplicationName(String applicationName)
Sets the specific application in various SQL Server profiling and logging tools.
Parameters:
setAuthentication
public void setAuthentication(String authentication)
Sets the authentication mode.
Parameters:
setAuthenticationScheme
public void setAuthenticationScheme(String authenticationScheme)
Sets the kind of integrated security you want your application to use.
Parameters:
setCalcBigDecimalPrecision
public void setCalcBigDecimalPrecision(boolean calcBigDecimalPrecision)
Sets the 'calcBigDecimalPrecision' setting.
Parameters:
setCancelQueryTimeout
public void setCancelQueryTimeout(int cancelQueryTimeout)
Sets the cancel timeout.
Parameters:
setClientCertificate
public void setClientCertificate(String certPath)
Sets client certificate path for client certificate authentication.
Parameters:
setClientKey
public void setClientKey(String keyPath)
Sets Private key file path for client certificate authentication.
Parameters:
setClientKeyPassword
public void setClientKeyPassword(String password)
Sets the password to be used for Private key provided by the user for client certificate authentication.
Parameters:
setColumnEncryptionSetting
public void setColumnEncryptionSetting(String columnEncryptionSetting)
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.
Parameters:
setConnectRetryCount
public void setConnectRetryCount(int count)
Sets the maximum number of attempts to reestablish a broken connection.
Parameters:
setConnectRetryInterval
public void setConnectRetryInterval(int interval)
Sets the interval, in seconds, between attempts to reestablish a broken connection.
Parameters:
setDatabaseName
public void setDatabaseName(String databaseName)
Sets the the database to connect to.
Parameters:
setDatetimeParameterType
public void setDatetimeParameterType(String datetimeParameterType)
Sets the SQL server datatype to use for Java datetime and timestamp values.
Parameters:
setDelayLoadingLobs
public void setDelayLoadingLobs(boolean delayLoadingLobs)
Specifies the flag to load LOBs instead of streaming them.
Parameters:
setDescription
public void setDescription(String description)
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".
Parameters:
setDisableStatementPooling
public void setDisableStatementPooling(boolean disableStatementPooling)
Sets the value to disable/enable statement pooling.
Parameters:
setDomain
public void setDomain(String domain)
Sets the 'domain' connection property used for NTLM Authentication.
Parameters:
setEnablePrepareOnFirstPreparedStatementCall
public 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. 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.
Parameters:
setEnclaveAttestationProtocol
public void setEnclaveAttestationProtocol(String protocol)
Sets the enclave attestation protocol to be used in Always Encrypted with Secure Enclaves.
Parameters:
setEnclaveAttestationUrl
public void setEnclaveAttestationUrl(String url)
Sets the enclave attestation URL used in Always Encrypted with Secure Enclaves.
Parameters:
setEncrypt
(=10.1.0,=true)
public void setEncrypt(boolean encryptOption)
Deprecated
Sets the option whether TLS encryption is used.
Parameters:
setEncrypt
public void setEncrypt(String encryptOption)
Sets the option whether TLS encryption is used.
Parameters:
setFIPS
public void setFIPS(boolean fips)
Sets whether Fips Mode should be enabled/disabled on the connection. For FIPS enabled JVM this property should be true.
Parameters:
setFailoverPartner
public void setFailoverPartner(String serverName)
Sets the fail over partner of the target SQL Server.
Parameters:
setGSSCredentials
public void setGSSCredentials(GSSCredential userCredential)
Sets the GSSCredential.
Parameters:
setHostNameInCertificate
public void setHostNameInCertificate(String hostName)
Sets the host name to be used in validating the SQL Server Secure Sockets Layer (SSL) certificate.
Parameters:
setIPAddressPreference
public void setIPAddressPreference(String iPAddressPreference)
Set the preferred type of IP Address
Parameters:
setInstanceName
public void setInstanceName(String instanceName)
Sets the the SQL Server instance name to connect to.
Parameters:
setIntegratedSecurity
public void setIntegratedSecurity(boolean enable)
Sets a Boolean value that indicates if the integratedSecurity property is enabled.
Parameters:
setJAASConfigurationName
public void setJAASConfigurationName(String configurationName)
Sets the login configuration name for Kerberos authentication. This overrides the default configuration SQLJDBCDriver
Parameters:
setJASSConfigurationName
(=9.3.0,=true)
public void setJASSConfigurationName(String configurationName)
Deprecated
Sets the login configuration name for Kerberos authentication. This overrides the default configuration SQLJDBCDriver
Parameters:
setKeyStoreAuthentication
public void setKeyStoreAuthentication(String keyStoreAuthentication)
Sets the name that identifies a key store. Only value supported is the "JavaKeyStorePassword" for identifying the Java Key Store. The default is null.
Parameters:
setKeyStoreLocation
public void setKeyStoreLocation(String keyStoreLocation)
Sets the location including the file name for the Java keystore. Note that, keyStoreAuthentication must be set with "JavaKeyStorePassword".
Parameters:
setKeyStorePrincipalId
public void setKeyStorePrincipalId(String keyStorePrincipalId)
Sets the value for the connection property 'keyStorePrincipalId'.
Parameters:
setKeyStoreSecret
public void setKeyStoreSecret(String keyStoreSecret)
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".
Parameters:
setKeyVaultProviderClientId
public void setKeyVaultProviderClientId(String keyVaultProviderClientId)
Sets the Azure Key Vault (AKV) Provider Client Id to provided value to be used for column encryption.
Parameters:
setKeyVaultProviderClientKey
public void setKeyVaultProviderClientKey(String keyVaultProviderClientKey)
Sets the Azure Key Vault (AKV) Provider Client Key to provided value to be used for column encryption.
Parameters:
setLastUpdateCount
public void setLastUpdateCount(boolean lastUpdateCount)
Sets a Boolean value that indicates if the lastUpdateCount property is enabled.
Parameters:
setLockTimeout
public void setLockTimeout(int lockTimeout)
Sets the lock timeout value.
Parameters:
setLogWriter
public void setLogWriter(PrintWriter out)
Parameters:
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.
Parameters:
setMSIClientId
(=12.1.0,=true)
public void setMSIClientId(String managedIdentityClientId)
Deprecated
Sets the client id to be used to retrieve the access token for a user-assigned Managed Identity.
Parameters:
setMaxResultBuffer
public void setMaxResultBuffer(String maxResultBuffer)
Sets the value for 'maxResultBuffer' property
Parameters:
setMsiTokenCacheTtl
(=12.1.0,=true)
public void setMsiTokenCacheTtl(int timeToLive)
Deprecated
Time-to-live is no longer supported for the cached Managed Identity tokens. This method is a no-op for backwards compatibility only.
Parameters:
setMultiSubnetFailover
public void setMultiSubnetFailover(boolean multiSubnetFailover)
Sets the value of the multiSubnetFailover connection property.
Parameters:
setPacketSize
public void setPacketSize(int packetSize)
Sets the packet size.
Parameters:
setPassword
public void setPassword(String password)
Sets the password that will be used when connecting to SQL Server.
Parameters:
setPortNumber
public void setPortNumber(int portNumber)
Sets the TCP-IP port number used when opening a socket connection to SQL Server.
Parameters:
setPrepareMethod
public void setPrepareMethod(String prepareMethod)
Sets the behavior for the prepare method. PrepareMethod
Parameters:
setQueryTimeout
public void setQueryTimeout(int queryTimeout)
Setting the query timeout.
Parameters:
setRealm
public void setRealm(String realm)
Sets the realm for Kerberos authentication.
Parameters:
setReplication
public void setReplication(boolean replication)
Sets the value to enable/disable the replication connection property.
Parameters:
setResponseBuffering
public void setResponseBuffering(String bufferingMode)
Sets the response buffering mode for connections created by using this SQLServerDataSource object.
Parameters:
setSSLProtocol
public void setSSLProtocol(String sslProtocol)
Sets the sslProtocol property for connection Set this value to specify TLS protocol keyword. Acceptable values are: TLS, TLSv1, TLSv1.1, and TLSv1.2.
Parameters:
setSelectMethod
public void setSelectMethod(String selectMethod)
Sets the default cursor type used for the result set.
Parameters:
setSendStringParametersAsUnicode
public void setSendStringParametersAsUnicode(boolean sendStringParametersAsUnicode)
Sets whether string parameters are sent to the server in UNICODE format.
Parameters:
setSendTemporalDataTypesAsStringForBulkCopy
public void setSendTemporalDataTypesAsStringForBulkCopy(boolean sendTemporalDataTypesAsStringForBulkCopy)
Specifies the flag to send temporal datatypes as String for Bulk Copy.
Parameters:
setSendTimeAsDatetime
public void setSendTimeAsDatetime(boolean sendTimeAsDatetime)
Sets the value to enable/disable the sendTimeAsDatetime connection property.
Parameters:
setServerCertificate
public void setServerCertificate(String cert)
Sets the connection property 'serverCertificate' on the connection.
Parameters:
setServerName
public void setServerName(String serverName)
Sets the host name of the target SQL Server.
Parameters:
setServerNameAsACE
public void setServerNameAsACE(boolean serverNameAsACE)
Sets whether the serverName will be translated from Unicode to ASCII Compatible Encoding (ACE).
Parameters:
setServerPreparedStatementDiscardThreshold
public 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. 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.
Parameters:
setServerSpn
public void setServerSpn(String serverSpn)
Sets the Service Principal Name (SPN) of the target SQL Server. https://msdn.microsoft.com/en-us/library/cc280459.aspx
Parameters:
setSocketFactoryClass
public void setSocketFactoryClass(String socketFactoryClass)
Sets the connection property 'socketFactoryClass' on the connection.
Parameters:
setSocketFactoryConstructorArg
public void setSocketFactoryConstructorArg(String socketFactoryConstructorArg)
Sets Constructor Arguments to be provided on constructor of 'socketFactoryClass'.
Parameters:
setSocketTimeout
public void setSocketTimeout(int socketTimeout)
Sets the socket timeout value.
Parameters:
setStatementPoolingCacheSize
public void setStatementPoolingCacheSize(int statementPoolingCacheSize)
Sets the size of the prepared statement cache for this connection. A value less than 1 means no cache.
Parameters:
setTransparentNetworkIPResolution
public void setTransparentNetworkIPResolution(boolean tnir)
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
Parameters:
setTrustManagerClass
public void setTrustManagerClass(String trustManagerClass)
Sets the connection property 'trustManagerClass' on the connection.
Parameters:
setTrustManagerConstructorArg
public void setTrustManagerConstructorArg(String trustManagerConstructorArg)
Sets Constructor Arguments to be provided on constructor of 'trustManagerClass'.
Parameters:
setTrustServerCertificate
public void setTrustServerCertificate(boolean e)
Sets a boolean value that indicates if the trustServerCertificate property is enabled.
Parameters:
setTrustStore
public void setTrustStore(String trustStore)
Sets the path (including file name) to the certificate trustStore file.
Parameters:
setTrustStorePassword
public void setTrustStorePassword(String trustStorePassword)
Sets the password that is used to check the integrity of the trustStore data.
Parameters:
setTrustStoreType
public void setTrustStoreType(String trustStoreType)
Sets the keystore type for the trustStore.
Parameters:
setURL
public void setURL(String url)
Sets the datasource URL.
Parameters:
setUseBulkCopyForBatchInsert
public void setUseBulkCopyForBatchInsert(boolean useBulkCopyForBatchInsert)
Sets whether the use Bulk Copy API should be used for Batch Insert.
Parameters:
setUseDefaultGSSCredential
public void setUseDefaultGSSCredential(boolean enable)
Sets the value to indicate whether useDefaultGSSCredential is enabled.
Parameters:
setUseDefaultJaasConfig
public void setUseDefaultJaasConfig(boolean useDefaultJaasConfig)
Sets whether the default JAAS Configuration will be used. This means the system-wide JAAS configuration is ignored to avoid conflicts with libraries that override the JAAS configuration.
Parameters:
setUseFlexibleCallableStatements
public void setUseFlexibleCallableStatements(boolean enable)
Sets whether or not sp_sproc_columns will be used for parameter name lookup.
Parameters:
setUseFmtOnly
public void setUseFmtOnly(boolean useFmtOnly)
Specifies the flag to use FMTONLY for parameter metadata queries.
Parameters:
setUser
public void setUser(String user)
Sets the user name that will be used when connecting to SQL Server.
Parameters:
setWorkstationID
public void setWorkstationID(String workstationID)
Sets the name of the client machine (or client workstation).
Parameters:
setXopenStates
public void setXopenStates(boolean xopenStates)
Sets whether the driver will convert SQL states to XOPEN compliant states.
Parameters:
setcacheBulkCopyMetadata
public void setcacheBulkCopyMetadata(boolean cacheBulkCopyMetadata)
Returns value of 'cacheBulkCopyMetadata' from Connection String.
Parameters:
toString
public String toString()
Overrides:
SQLServerDataSource.toString()