Package com.microsoft.sqlserver.jdbc

## Interface ISQLServerDataSource

All Superinterfaces:
  `CommonDataSource`

All Known Implementing Classes:
  `SQLServerConnectionPoolDataSource`, `SQLServerDataSource`, `SQLServerXADataSource`

    public interface ISQLServerDataSource
    extends CommonDataSource

A factory to create connections to the data source represented by this object. This interface was added in SQL Server JDBC Driver 3.0.

### Method Summary

All Methods Instance Methods Abstract Methods
`String` `getApplicationIntent()` Returns the application intent.
`String` `getApplicationName()` Returns the application name.
`String` `getDatabaseName()` Returns the database name.
`String` `getDescription()` Returns a description of the data source.
`boolean` `getEncrypt()` Returns a Boolean value that indicates if the encrypt property is enabled.
`String` `getFailoverPartner()` Returns the name of the failover server that is used in a database mirroring configuration.
`String` `getHostNameInCertificate()` Returns the host name used in validating the SQL Server Secure Sockets Layer (SSL) certificate.
`String` `getInstanceName()` Returns the SQL Server instance name.
`boolean` `getLastUpdateCount()` Returns a Boolean value that indicates if the lastUpdateCount property is enabled.
`int` `getLockTimeout()` Returns an int value that indicates the number of milliseconds that the database will wait before reporting a lock time out.
`boolean` `getMultiSubnetFailover()` Returns the value of the multiSubnetFailover connection property.
`int` `getPacketSize()` Returns the current network packet size used to communicate with SQL Server, specified in bytes.
`int` `getPortNumber()` Returns the current port number that is used to communicate with SQL Server.
`String` `getResponseBuffering()` Returns the response buffering mode for this SQLServerDataSource object.
`String` `getSelectMethod()` Returns the default cursor type used for all result sets that are created by using this SQLServerDataSource object.
`boolean` `getSendStringParametersAsUnicode()` Returns a boolean value that indicates if sending string parameters to the server in UNICODE format is enabled.
`boolean` `getSendTimeAsDatetime()` This method was added in SQL Server JDBC Driver 3.0.
`String` `getServerName()` Returns the name of the SQL Server instance.
`String` `getServerSpn()` Returns the server spn
`boolean` `getTrustServerCertificate()` Returns a Boolean value that indicates if the trustServerCertificate property is enabled.
`String` `getTrustStore()` Returns the path (including file name) to the certificate trustStore file.
`String` `getURL()` Returns the URL that is used to connect to the data source.
`String` `getUser()` Returns the user name that is used to connect the data source.
`String` `getWorkstationID()` Returns the name of the client computer name that is used to connect to the data source.
`boolean` `getXopenStates()` Returns a boolean value that indicates if converting SQL states to XOPEN compliant states is enabled.
`void` `setApplicationIntent​(String applicationIntent)` Sets the application intent.
`void` `setApplicationName​(String applicationName)` Sets the application name.
`void` `setAuthenticationScheme​(String authenticationScheme)` Indicates the kind of integrated security you want your application to use.
`void` `setDatabaseName​(String databaseName)` Sets the database name to connect to.
`void` `setDescription​(String description)` Sets the description of the data source.
`void` `setEncrypt​(boolean encrypt)` Sets a Boolean value that indicates if the encrypt property is enabled.
`void` `setFailoverPartner​(String serverName)` Sets the name of the failover server that is used in a database mirroring configuration.
`void` `setHostNameInCertificate​(String host)` Sets the host name to be used in validating the SQL Server Secure Sockets Layer (SSL) certificate.
`void` `setInstanceName​(String instanceName)` Sets the SQL Server instance name.
`void` `setIntegratedSecurity​(boolean enable)` Sets a Boolean value that indicates if the integratedSecurity property is enabled.
`void` `setLastUpdateCount​(boolean lastUpdateCount)` Sets a Boolean value that indicates if the lastUpdateCount property is enabled.
`void` `setLockTimeout​(int lockTimeout)` Sets an int value that indicates the number of milliseconds to wait before the database reports a lock time out.
`void` `setMultiSubnetFailover​(boolean multiSubnetFailover)` Sets the value of the multiSubnetFailover connection property.
`void` `setPacketSize​(int packetSize)` Sets the current network packet size used to communicate with SQL Server, specified in bytes.
`void` `setPassword​(String password)` Sets the password that will be used to connect to SQL Server.
`void` `setPortNumber​(int portNumber)` Sets the port number to be used to communicate with SQL Server.
`void` `setResponseBuffering​(String respo)` Sets the response buffering mode for connections created by using this SQLServerDataSource object.
`void` `setSelectMethod​(String selectMethod)` Sets the default cursor type that is used for all result sets that are created by using this SQLServerDataSource object.
`void` `setSendStringParametersAsUnicode​(boolean sendStringParametersAsUnicode)` Sets a boolean value that indicates if sending string parameters to the server in UNICODE format is enabled.
`void` `setSendTimeAsDatetime​(boolean sendTimeAsDatetime)` Modifies the setting of the sendTimeAsDatetime connection property.
`void` `setServerName​(String serverName)` Sets the name of the computer that is running SQL Server.
`void` `setServerSpn​(String serverSpn)` Sets the server spn
`void` `setTrustServerCertificate​(boolean e)` Sets a Boolean value that indicates if the trustServerCertificate property is enabled.
`void` `setTrustStore​(String st)` Sets the path (including file name) to the certificate trustStore file.
`void` `setTrustStorePassword​(String p)` Sets the password that is used to check the integrity of the trustStore data.
`void` `setURL​(String url)` Sets the URL that is used to connect to the data source.
`void` `setUser​(String user)` Sets the user name that is used to connect the data source.
`void` `setWorkstationID​(String workstationID)` Sets the name of the client computer name that is used to connect to the data source.
`void` `setXopenStates​(boolean xopenStates)` Sets a Boolean value that indicates if converting SQL states to XOPEN compliant states is enabled.

### Methods inherited from interface javax.sql.CommonDataSource

`createShardingKeyBuilder, getLoginTimeout, getLogWriter, getParentLogger, setLoginTimeout, setLogWriter`

### Method Detail

#### setApplicationIntent

    void setApplicationIntent​(String applicationIntent)

Sets the application intent.

Parameters:
  `applicationIntent` - A String that contains the application intent.

#### getApplicationIntent

    String getApplicationIntent()

Returns the application intent.

Returns:
  A String that contains the application intent.

#### setApplicationName

    void setApplicationName​(String applicationName)

Sets the application name.

Parameters:
  `applicationName` - A String that contains the name of the application.

#### getApplicationName

    String getApplicationName()

Returns the application name.

Returns:
  A String that contains the application name, or "Microsoft JDBC Driver for SQL Server" if no value is set.

#### setDatabaseName

    void setDatabaseName​(String databaseName)

Sets the database name to connect to.

Parameters:
  `databaseName` - A String that contains the database name.

#### getDatabaseName

    String getDatabaseName()

Returns the database name.

Returns:
  A String that contains the database name or null if no value is set.

#### setInstanceName

    void setInstanceName​(String instanceName)

Sets the SQL Server instance name.

Parameters:
  `instanceName` - A String that contains the instance name.

#### getInstanceName

    String getInstanceName()

Returns the SQL Server instance name.

Returns:
  A String that contains the instance name, or null if no value is set.

#### setIntegratedSecurity

    void setIntegratedSecurity​(boolean enable)

Sets a Boolean value that indicates if the integratedSecurity property is enabled.

Parameters:
  `enable` - true if integratedSecurity is enabled. Otherwise, false.

#### setLastUpdateCount

    void setLastUpdateCount​(boolean lastUpdateCount)

Sets a Boolean value that indicates if the lastUpdateCount property is enabled.

Parameters:
  `lastUpdateCount` - true if lastUpdateCount is enabled. Otherwise, false.

#### getLastUpdateCount

    boolean getLastUpdateCount()

Returns a Boolean value that indicates if the lastUpdateCount property is enabled.

Returns:
  true if lastUpdateCount is enabled. Otherwise, false.

#### setEncrypt

    void setEncrypt​(boolean encrypt)

Sets a Boolean value that indicates if the encrypt property is enabled.

Parameters:
  `encrypt` - true if the Secure Sockets Layer (SSL) encryption is enabled between the client and the SQL Server. Otherwise, false.

#### getEncrypt

    boolean getEncrypt()

Returns a Boolean value that indicates if the encrypt property is enabled.

Returns:
  true if encrypt is enabled. Otherwise, false.

#### setTrustServerCertificate

    void setTrustServerCertificate​(boolean e)

Sets a Boolean value that indicates if the trustServerCertificate property is enabled.

Parameters:
  `e` - true if the server Secure Sockets Layer (SSL) certificate should be automatically trusted when the communication layer is encrypted using SSL. Otherwise, false.

#### getTrustServerCertificate

    boolean getTrustServerCertificate()

Returns a Boolean value that indicates if the trustServerCertificate property is enabled.

Returns:
  true if trustServerCertificate is enabled. Otherwise, false.

#### setTrustStore

    void setTrustStore​(String st)

Sets the path (including file name) to the certificate trustStore file.

Parameters:
  `st` - A String that contains the path (including file name) to the certificate trustStore file.

#### getTrustStore

    String getTrustStore()

Returns the path (including file name) to the certificate trustStore file.

Returns:
  A String that contains the path (including file name) to the certificate trustStore file, or null if no value is set.

#### setTrustStorePassword

    void setTrustStorePassword​(String p)

Sets the password that is used to check the integrity of the trustStore data.

Parameters:
  `p` - A String that contains the password that is used to check the integrity of the trustStore data.

#### setHostNameInCertificate

    void setHostNameInCertificate​(String host)

Sets the host name to be used in validating the SQL Server Secure Sockets Layer (SSL) certificate.

Parameters:
  `host` - A String that contains the host name.

#### getHostNameInCertificate

    String getHostNameInCertificate()

Returns the host name used in validating the SQL Server Secure Sockets Layer (SSL) certificate.

Returns:
  A String that contains the host name, or null if no value is set.

#### setLockTimeout

    void setLockTimeout​(int lockTimeout)

Sets an int value that indicates the number of milliseconds to wait before the database reports a lock time out.

Parameters:
  `lockTimeout` - An int value that contains the number of milliseconds to wait.

#### getLockTimeout

    int getLockTimeout()

Returns an int value that indicates the number of milliseconds that the database will wait before reporting a lock time out.

Returns:
  An int value that contains the number of milliseconds that the database will wait.

#### setPassword

    void setPassword​(String password)

Sets the password that will be used to connect to SQL Server.

Parameters:
  `password` - A String that contains the password.

#### setPortNumber

    void setPortNumber​(int portNumber)

Sets the port number to be used to communicate with SQL Server.

Parameters:
  `portNumber` - An int value that contains the port number.

#### getPortNumber

    int getPortNumber()

Returns the current port number that is used to communicate with SQL Server.

Returns:
  An int value that contains the current port number.

#### setSelectMethod

    void setSelectMethod​(String selectMethod)

Sets the default cursor type that is used for all result sets that are created by using this SQLServerDataSource object.

Parameters:
  `selectMethod` - A String value that contains the default cursor type.

#### getSelectMethod

    String getSelectMethod()

Returns the default cursor type used for all result sets that are created by using this SQLServerDataSource object.

Returns:
  A String value that contains the default cursor type.

#### setResponseBuffering

    void setResponseBuffering​(String respo)

Sets the response buffering mode for connections created by using this SQLServerDataSource object.

Parameters:
  `respo` - 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

    String getResponseBuffering()

Returns the response buffering mode for this SQLServerDataSource object.

Returns:
  A String that contains a lower-case full or adaptive.

#### setSendTimeAsDatetime

    void setSendTimeAsDatetime​(boolean sendTimeAsDatetime)

Modifies the setting of the sendTimeAsDatetime connection property.

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

    boolean getSendTimeAsDatetime()

This method was added in SQL Server JDBC Driver 3.0. Returns the setting of the sendTimeAsDatetime connection property.

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.

#### setSendStringParametersAsUnicode

    void setSendStringParametersAsUnicode​(boolean sendStringParametersAsUnicode)

Sets a boolean value that indicates if sending string parameters to the server in UNICODE format is enabled.

Parameters:
  `sendStringParametersAsUnicode` - true if string parameters are sent to the server in UNICODE format. Otherwise, false.

#### getSendStringParametersAsUnicode

    boolean getSendStringParametersAsUnicode()

Returns a boolean value that indicates if sending string parameters to the server in UNICODE format is enabled.

Returns:
  true if string parameters are sent to the server in UNICODE format. Otherwise, false.

#### setServerName

    void setServerName​(String serverName)

Sets the name of the computer that is running SQL Server.

Parameters:
  `serverName` - A String that contains the server name.

#### getServerName

    String getServerName()

Returns the name of the SQL Server instance.

Returns:
  A String that contains the server name or null if no value is set.

#### setFailoverPartner

    void setFailoverPartner​(String serverName)

Sets the name of the failover server that is used in a database mirroring configuration.

Parameters:
  `serverName` - A String that contains the failover server name.

#### getFailoverPartner

    String getFailoverPartner()

Returns the name of the failover server that is used in a database mirroring configuration.

Returns:
  A String that contains the name of the failover partner, or null if none is set.

#### setMultiSubnetFailover

    void setMultiSubnetFailover​(boolean multiSubnetFailover)

Sets the value of the multiSubnetFailover connection property.

Parameters:
  `multiSubnetFailover` - The new value of the multiSubnetFailover connection property.

#### getMultiSubnetFailover

    boolean getMultiSubnetFailover()

Returns the value of the multiSubnetFailover connection property.

Returns:
  Returns true or false, depending on the current setting of the connection property.

#### setUser

    void setUser​(String user)

Sets the user name that is used to connect the data source.

Parameters:
  `user` - A String that contains the user name.

#### getUser

    String getUser()

Returns the user name that is used to connect the data source.

Returns:
  A String that contains the user name.

#### setWorkstationID

    void setWorkstationID​(String workstationID)

Sets the name of the client computer name that is used to connect to the data source.

Parameters:
  `workstationID` - A String that contains the client computer name.

#### getWorkstationID

    String getWorkstationID()

Returns the name of the client computer name that is used to connect to the data source.

Returns:
  A String that contains the client computer name.

#### setXopenStates

    void setXopenStates​(boolean xopenStates)

Sets a Boolean value that indicates if converting SQL states to XOPEN compliant states is enabled.

Parameters:
  `xopenStates` - true if converting SQL states to XOPEN compliant states is enabled. Otherwise, false.

#### getXopenStates

    boolean getXopenStates()

Returns a boolean value that indicates if converting SQL states to XOPEN compliant states is enabled.

Returns:
  true if converting SQL states to XOPEN compliant states is enabled. Otherwise, false.

#### setURL

    void setURL​(String url)

Sets the URL that is used to connect to the data source.

Parameters:
  `url` - A String that contains the URL.

#### getURL

    String getURL()

Returns the URL that is used to connect to the data source.

Returns:
  A String that contains the URL.

#### setDescription

    void setDescription​(String description)

Sets the description of the data source.

Parameters:
  `description` - A String that contains the description.

#### getDescription

    String getDescription()

Returns a description of the data source.

Returns:
  A String that contains the data source description or null if no value is set.

#### setPacketSize

    void setPacketSize​(int packetSize)

Sets the current network packet size used to communicate with SQL Server, specified in bytes.

Parameters:
  `packetSize` - An int value containing the network packet size.

#### getPacketSize

    int getPacketSize()

Returns the current network packet size used to communicate with SQL Server, specified in bytes.

Returns:
  An int value containing the current network packet size.

#### setAuthenticationScheme

    void setAuthenticationScheme​(String authenticationScheme)

Indicates the kind of integrated security you want your application to use.

Parameters:
  `authenticationScheme` - Values are "JavaKerberos" and the default "NativeAuthentication".

#### setServerSpn

    void setServerSpn​(String serverSpn)

Sets the server spn

Parameters:
  `serverSpn` - A String that contains the server spn

#### getServerSpn

    String getServerSpn()

Returns the server spn

Returns:
  A String that contains the server spn