DB2®ConnectionStringBuilder.Connect_Timeout Property

Gets or sets the number of seconds for a connection attempt to timeout.

Namespace:
IBM.Data.DB2
Assembly:
IBM.Data.DB2 (in IBM.Data.DB2.dll)

Syntax


[Visual Basic]
Public Property Connect_Timeout As int
[C#]
public int Connect_Timeout {get; set;}
[C++]
public: __property int* get_Connect_Timeout();
public: __property void set_Connect_Timeout(int*);
[JScript]
public function get Connect_Timeout() : int;
public function set Connect_Timeout(int);

Property value

An integer, greater than or equal to 0 and less than or equal to 32767, that represents how many seconds the connection waits before timing out. By default, the connection waits indefinitely.

Remarks

One second is the smallest interval for checking the timeout value. Therefore, the timeout event can take up to an additional second after the set timeout value.

If the Connect_Timeout property is set and client reroute is enabled against the Db2®, a connection is attempted only once to the original server and once to the alternate server. Because the Connect_Timeout value is used when attempting to connect to each server, the maximum waiting time is approximately double the Connect_Timeout value specified. Other high availability solutions, such as the Sysplex feature, is also affected and the maximum waiting time is approximately equal to the number of Sysplex members, multiplied by the amount of time that is specified by the Connect_Timeout keyword.

Regardless of a high availability solution being enabled, the Connect_Timeout value is enforced for a connection. If a connection attempt fails within the time that is specified by the Connect_Timeout value, control is returned to the application with an SQL30081N error. The error and control is returned whether all alternative servers are tried or not.

The Connect_Timeout value applies only to the TCPIP protocol and is not supported for connections to databases cataloged on a SOCKS-enabled TCP/IP node.