--- title: "setQueryTimeout Method (SQLServerStatement) | Microsoft Docs" ms.custom: "" ms.date: "01/19/2017" ms.prod: sql ms.prod_service: connectivity ms.reviewer: "" ms.technology: connectivity ms.topic: conceptual apiname: - "SQLServerStatement.setQueryTimeout" apilocation: - "sqljdbc.jar" apitype: "Assembly" ms.assetid: 0c513265-cd0c-4b38-9494-94458c17a16d author: David-Engel ms.author: v-daenge --- # setQueryTimeout Method (SQLServerStatement) [!INCLUDE[Driver_JDBC_Download](../../../includes/driver_jdbc_download.md)] Sets the number of seconds the driver will wait for a [SQLServerStatement](../../../connect/jdbc/reference/sqlserverstatement-class.md) object to run to the given number of seconds. ## Syntax ``` public final void setQueryTimeout(int seconds) ``` #### Parameters *seconds* An **int** that indicates the number of seconds to wait, or 0 if there is no limit. ## Exceptions [SQLServerException](../../../connect/jdbc/reference/sqlserverexception-class.md) ## Remarks This setQueryTimeout method is specified by the setQueryTimeout method in the java.sql.Statement interface. ## See Also [SQLServerStatement Members](../../../connect/jdbc/reference/sqlserverstatement-members.md) [SQLServerStatement Class](../../../connect/jdbc/reference/sqlserverstatement-class.md)