public interface Wrapper
包装图案是由许多的JDBC驱动程序的实现来提供扩展超出特定于数据源的传统的JDBC API。开发人员可能希望访问这些被包(委托)的这些资源,作为代表实际资源的代理类实例。此接口描述了一个标准的机制来访问这些包裹的资源为代表的他们的代理,以允许直接访问的资源代表。
<T> T unwrap(类<T> iface) throws SQLException
unwrap
递归调用包装的对象或结果,代理。如果接收器没有包装,没有实现接口,然后
SQLException
抛出。
T
-类仿照这个类对象的类型
iface
-一个类定义一个接口,因此必须实现。
SQLException
-如果没有对象发现实现的接口
boolean isWrapperFor(类<?> iface) throws SQLException
isWrapperFor
对包装对象的结果。如果这不实现接口,并不是一个包装器,返回错误。这种方法应该比
unwrap
使呼叫者可以使用这个方法来避免昂贵的
unwrap
调用可能失败的低成本运作的实施。如果此方法返回true,然后用相同的参数调用
unwrap
成功。
iface
-一个类中定义一个接口。
SQLException
如果确定这是否是一个与给定接口的包装对象时发生错误。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.