Driver version
6.2.2
SQL Server version
Any
Client Operating System
Linux or Mac or Windows
JAVA/JVM version
1.8
Table schema
No need
Problem description
When I set logintimeout in URL, I expect that the connection would timeout by the setting in URL. But it would timeout by the global loginTimeout setting.
And the problem is caused by the loginTimeout property is overwritten in SQLServerDriver.parseAndMergeProperties

Reproduction code
With the following code, the connection would timeout in 60 seconds not 5 seconds.
DriverManager.setLoginTimeout(60)
println(new Date().toString())
try {
url = "jdbc:sqlserver://10.0.2.15;userName=sa;password=PASSW0RD;database=master;socketTimeout=10000;logintimeout=5"
def sql = Sql.newInstance(url, "system", "123456", "com.microsoft.sqlserver.jdbc.SQLServerDriver")
}
catch (Exception e) {
println(e.getMessage())
println(new Date().toString())
}
Driver version
6.2.2
SQL Server version
Any
Client Operating System
Linux or Mac or Windows
JAVA/JVM version
1.8
Table schema
No need
Problem description
When I set logintimeout in URL, I expect that the connection would timeout by the setting in URL. But it would timeout by the global loginTimeout setting.
And the problem is caused by the loginTimeout property is overwritten in SQLServerDriver.parseAndMergeProperties

Reproduction code
With the following code, the connection would timeout in 60 seconds not 5 seconds.
DriverManager.setLoginTimeout(60)
println(new Date().toString())
try {
url = "jdbc:sqlserver://10.0.2.15;userName=sa;password=PASSW0RD;database=master;socketTimeout=10000;logintimeout=5"
def sql = Sql.newInstance(url, "system", "123456", "com.microsoft.sqlserver.jdbc.SQLServerDriver")
}
catch (Exception e) {
println(e.getMessage())
println(new Date().toString())
}