--- title: "setTimestamp Method (int, java.sql.Timestamp) | 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: - "SQLServerPreparedStatement.setTimestamp (int, java.sql.Timestamp)" apilocation: - "sqljdbc.jar" apitype: "Assembly" ms.assetid: 2f7bb89f-ace7-41cb-b596-5aa8d0dd9e3c author: David-Engel ms.author: v-daenge --- # setTimestamp Method (int, java.sql.Timestamp) [!INCLUDE[Driver_JDBC_Download](../../../includes/driver_jdbc_download.md)] Sets the designated parameter to the given timestamp value. ## Syntax ``` public final void setTimestamp(int n, java.sql.Timestamp x) ``` #### Parameters *n* An **int** that indicates the parameter number. *x* A Timestamp object. ## Exceptions [SQLServerException](../../../connect/jdbc/reference/sqlserverexception-class.md) ## Remarks This setTimestamp method is specified by the setTimestamp method in the java.sql.PreparedStatement interface. ## See Also [setTimestamp Method (SQLServerPreparedStatement)](../../../connect/jdbc/reference/settimestamp-method-sqlserverpreparedstatement.md) [SQLServerPreparedStatement Members](../../../connect/jdbc/reference/sqlserverpreparedstatement-members.md) [SQLServerPreparedStatement Class](../../../connect/jdbc/reference/sqlserverpreparedstatement-class.md)