Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated loginTimeout default value to 30s to be consistent with other drivers #1885

Merged
merged 2 commits into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
- Added explicit dependency for com.microsoft.azure.msal4j (was a transitive dependency in previous releases) [1863](https://github.com/microsoft/mssql-jdbc/pull/1863)

### Changed
- Changed default loginTimeout value to 30s [1885](https://github.com/microsoft/mssql-jdbc/pull/1885)
- Updated dependency versions of com.azure.azure-security-keyvault-keys and com.azure.azure-identity [1863](https://github.com/microsoft/mssql-jdbc/pull/1863)
- Send TDS version 8 in Login7 when in strict mode (encrypt=strict) [1870](https://github.com/microsoft/mssql-jdbc/pull/1870)
- Validate that the serverName field of the connection string does not have an equal sign [1853](https://github.com/microsoft/mssql-jdbc/pull/1853)
Expand Down
11 changes: 4 additions & 7 deletions src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,7 @@ static IPAddressPreference valueOfString(String value) throws SQLServerException
iptype = IPAddressPreference.IPv4First;
} else if (value.toLowerCase(Locale.US).equalsIgnoreCase(IPAddressPreference.IPv6First.toString())) {
iptype = IPAddressPreference.IPv6First;
} else if (value.toLowerCase(Locale.US)
.equalsIgnoreCase(IPAddressPreference.UsePlatformDefault.toString())) {
} else if (value.toLowerCase(Locale.US).equalsIgnoreCase(IPAddressPreference.UsePlatformDefault.toString())) {
iptype = IPAddressPreference.UsePlatformDefault;

} else {
Expand Down Expand Up @@ -517,7 +516,7 @@ public String toString() {
enum SQLServerDriverIntProperty {
PACKET_SIZE("packetSize", TDS.DEFAULT_PACKET_SIZE),
LOCK_TIMEOUT("lockTimeout", -1),
LOGIN_TIMEOUT("loginTimeout", 15, 0, 65535),
LOGIN_TIMEOUT("loginTimeout", 30, 0, 65535),
QUERY_TIMEOUT("queryTimeout", -1),
PORT_NUMBER("portNumber", 1433),
SOCKET_TIMEOUT("socketTimeout", 0),
Expand Down Expand Up @@ -694,8 +693,7 @@ public final class SQLServerDriver implements java.sql.Driver {
SQLServerDriverStringProperty.SERVER_NAME.getDefaultValue(), false, null),
new SQLServerDriverPropertyInfo(SQLServerDriverStringProperty.IPADDRESS_PREFERENCE.toString(),
SQLServerDriverStringProperty.IPADDRESS_PREFERENCE.getDefaultValue(), false,
new String[] {IPAddressPreference.IPv4First.toString(),
IPAddressPreference.IPv6First.toString(),
new String[] {IPAddressPreference.IPv4First.toString(), IPAddressPreference.IPv6First.toString(),
IPAddressPreference.UsePlatformDefault.toString()}),
new SQLServerDriverPropertyInfo(SQLServerDriverStringProperty.SERVER_SPN.toString(),
SQLServerDriverStringProperty.SERVER_SPN.getDefaultValue(), false, null),
Expand Down Expand Up @@ -777,8 +775,7 @@ public final class SQLServerDriver implements java.sql.Driver {
new SQLServerDriverPropertyInfo(SQLServerDriverStringProperty.MSI_CLIENT_ID.toString(),
SQLServerDriverStringProperty.MSI_CLIENT_ID.getDefaultValue(), false, null),
new SQLServerDriverPropertyInfo(SQLServerDriverIntProperty.MSI_TOKEN_CACHE_TTL.toString(),
Integer.toString(SQLServerDriverIntProperty.MSI_TOKEN_CACHE_TTL.getDefaultValue()), false,
null),
Integer.toString(SQLServerDriverIntProperty.MSI_TOKEN_CACHE_TTL.getDefaultValue()), false, null),
new SQLServerDriverPropertyInfo(SQLServerDriverStringProperty.KEY_VAULT_PROVIDER_CLIENT_ID.toString(),
SQLServerDriverStringProperty.KEY_VAULT_PROVIDER_CLIENT_ID.getDefaultValue(), false, null),
new SQLServerDriverPropertyInfo(SQLServerDriverStringProperty.KEY_VAULT_PROVIDER_CLIENT_KEY.toString(),
Expand Down