IBM DB2 Information Integrator
Java API Reference
for Developing Wrappers

com.ibm.db2.wrapper
Class Wrapper

java.lang.Object
  extended bycom.ibm.db2.wrapper.SqlqgBaseClass
      extended bycom.ibm.db2.wrapper.Wrapper
Direct Known Subclasses:
FencedWrapper, UnfencedWrapper

public class Wrapper
extends com.ibm.db2.wrapper.SqlqgBaseClass

The Wrapper class represents the base class for a set of data sources. This class provides library initialization services and access to the data source servers that the wrapper supports. The Wrapper class maintains the following information:



Usage:
Do not use this class directly, but subclass the FencedGenericWrapper class and the UnfencedGenericWrapper class.

Since:
IBM DB2 Information Integrator Version 8.2

Method Summary
protected  Server createServer(java.lang.String serverName)
          Instantiate the appropriate subclass of Server for the wrapper.
protected  void destroy()
          Destroys this wrapper object and frees any resources associated with it.
 java.lang.String getCorelib()
          Retrieve the wrapper core library name.
 WrapperInfo getInfo()
          Retrieve the wrapper information that is stored in the federated server's system catalog as a result of running DDL statements.
 java.lang.String getName()
          Retrieve the wrapper name.
 char getType()
          Retrieve the wrapper type.
 int getVersion()
          Retrieve the version of the wrapper, which represents the version that is currently running.
protected  void initializeMyWrapper(WrapperInfo wrapperInfo)
          Initialize the wrapper object state from the catalog information object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createServer

protected Server createServer(java.lang.String serverName)
                       throws java.lang.Exception
Instantiate the appropriate subclass of Server for the wrapper. The wrapper writer must implement this method to create an instance of the wrapper-specific Server subclass.

Parameters:
serverName - The name of the data source server to be created, which is specified on the CREATE SERVER statement.
Returns:
The newly created Server instance.
Throws:
java.lang.Exception - if a new Server instance cannot be created.
Since:
IBM DB2 Information Integrator Version 8.2
See Also:
Server

destroy

protected void destroy()
                throws java.lang.Exception
Destroys this wrapper object and frees any resources associated with it. The default implementation does nothing. This method is called by the federated server before the wrapper object is removed and gives the wrapper a chance to free any resources allocated. If wrapper-specific resources need to be freed, the wrapper writer can implement this method in the wrapper-specific subclass of UnfencedGenericWrapper and FencedGenericWrapper.

Throws:
java.lang.Exception - if the processing fails.
Since:
IBM DB2 Information Integrator Version 8.2

getCorelib

public final java.lang.String getCorelib()
Retrieve the wrapper core library name. The returned name is the name of the native library that loaded the wrapper.

Returns:
The name of the library that loaded the wrapper.
Since:
IBM DB2 Information Integrator Version 8.2

getInfo

public final WrapperInfo getInfo()
Retrieve the wrapper information that is stored in the federated server's system catalog as a result of running DDL statements.

Returns:
The WrapperInfo object that contains the catalog information for the wrapper.
Since:
IBM DB2 Information Integrator Version 8.2
See Also:
WrapperInfo

getName

public final java.lang.String getName()
Retrieve the wrapper name.

Returns:
The name of the wrapper as specified in the CREATE WRAPPER statement.
Since:
IBM DB2 Information Integrator Version 8.2

getType

public char getType()
Retrieve the wrapper type. A default implementation returns a value of N. N is the only valid value.

Returns:
The type of the wrapper. By default, this method returns a value of N.
Since:
IBM DB2 Information Integrator Version 8.2

getVersion

public int getVersion()
Retrieve the version of the wrapper, which represents the version that is currently running. This value can be compared with the version from the time that the wrapper was registered with DB2 UDB to assure compatibility.

Returns:
The version of the wrapper.
Since:
IBM DB2 Information Integrator Version 8.2

initializeMyWrapper

protected void initializeMyWrapper(WrapperInfo wrapperInfo)
                            throws java.lang.Exception
Initialize the wrapper object state from the catalog information object. The default implementation does nothing. If wrapper-specific wrapper options are supported, the wrapper writer can implement this method in the wrapper-specific subclass of UnfencedGenericWrapper and FencedGenericWrapper.

Parameters:
wrapperInfo - The WrapperInfo instance that contains the catalog information for the wrapper.
Throws:
java.lang.Exception - if the initialization process fails.
Since:
IBM DB2 Information Integrator Version 8.2
See Also:
WrapperInfo

IBM DB2 Information Integrator
Java API Reference
for Developing Wrappers

(C)Copyright IBM Corp. 2002. All rights reserved.

Links on this page are made available for your convenience and may take you to non-IBM sites. IBM does not warrant any sample code provided on these sites.