Skip to content

Most visited

Recently visited

navigation
Added in API level 9

Wrapper

public interface Wrapper

java.sql.Wrapper
Known Indirect Subclasses


This class is an actual usage of the wrapper pattern for JDBC classes. Developers can get the delegate instance when the instance may be a proxy class.

Summary

Public methods

abstract boolean isWrapperFor(Class<?> iface)

If the caller is a wrapper of the class or implements the given interface, the methods return false and vice versa.

abstract <T> T unwrap(Class<T> iface)

Returns an object that implements the given interface.

Public methods

isWrapperFor

Added in API level 9
boolean isWrapperFor (Class<?> iface)

If the caller is a wrapper of the class or implements the given interface, the methods return false and vice versa.

Parameters
iface Class: - the class that defines the interface
Returns
boolean - true if the instance implements the interface
Throws
SQLException - when an error occurs when judges the object

unwrap

Added in API level 9
T unwrap (Class<T> iface)

Returns an object that implements the given interface. If the caller is not a wrapper, a SQLException will be thrown.

Parameters
iface Class: - the class that defines the interface
Returns
T - an object that implements the interface
Throws
SQLException - if there is no object implementing the specific interface
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.