--- title: "unwrap Method (SQLServerPreparedStatement) | Microsoft Docs" ms.custom: "" ms.date: "01/19/2017" ms.prod: sql ms.prod_service: connectivity ms.reviewer: "" ms.technology: connectivity ms.topic: conceptual ms.assetid: 8e3ec950-3ac1-4c28-9e97-ddce3bd46578 author: David-Engel ms.author: v-daenge --- # unwrap Method (SQLServerPreparedStatement) [!INCLUDE[Driver_JDBC_Download](../../../includes/driver_jdbc_download.md)] Returns an object that implements the specified interface to allow access to the [!INCLUDE[jdbcNoVersion](../../../includes/jdbcnoversion_md.md)]-specific methods. ## Syntax ``` public T unwrap(Class iface) ``` #### Parameters *iface* A class of type **T** defining an interface. ## Return Value An object that implements the specified interface. ## Exceptions [SQLServerException](../../../connect/jdbc/reference/sqlserverexception-class.md) ## Remarks The [unwrap](../../../connect/jdbc/reference/unwrap-method-sqlserverpreparedstatement.md) method is defined by the java.sql.Wrapper interface, which is introduced in the JDBC 4.0 Spec. Applications might need to access extensions to the JDBC API that are specific to the [!INCLUDE[jdbcNoVersion](../../../includes/jdbcnoversion_md.md)]. The unwrap method supports unwrapping to public classes that this object extends, if the classes expose vendor extensions. When this method is called, the object unwraps to the following classes: [SQLServerStatement](../../../connect/jdbc/reference/sqlserverstatement-class.md) and [SQLServerPreparedStatement](../../../connect/jdbc/reference/sqlserverpreparedstatement-class.md). For example code, see [unwrap Method (SQLServerCallableStatement)](../../../connect/jdbc/reference/unwrap-method-sqlservercallablestatement.md). For more information, see [Wrappers and Interfaces](../../../connect/jdbc/wrappers-and-interfaces.md). ## See Also [isWrapperFor Method (SQLServerPreparedStatement)](../../../connect/jdbc/reference/iswrapperfor-method-sqlserverpreparedstatement.md) [SQLServerPreparedStatement Members](../../../connect/jdbc/reference/sqlserverpreparedstatement-members.md) [SQLServerPreparedStatement Class](../../../connect/jdbc/reference/sqlserverpreparedstatement-class.md)