diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java index 3fd8a2fe7..cf0eb5728 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java @@ -1079,7 +1079,10 @@ Connection connect(Properties propsIn, // timeout, default is 15 per spec String sPropValue = propsIn.getProperty(SQLServerDriverIntProperty.LOGIN_TIMEOUT.toString()); if (null != sPropValue && sPropValue.length() > 0) { - loginTimeoutSeconds = Integer.parseInt(sPropValue); + int sPropValueInt = Integer.parseInt(sPropValue); + if (0 != sPropValueInt) { // Use the default timeout in case of a zero value + loginTimeoutSeconds = sPropValueInt; + } } }