IBM DB2 Information Integrator
Java API Reference
for Developing Wrappers

com.ibm.db2.wrapper
Class WrapperUtilities

java.lang.Object
  extended bycom.ibm.db2.wrapper.WrapperUtilities

public final class WrapperUtilities
extends java.lang.Object

The WrapperUtilities class is a container for several static utility functions. Do not instantiate or subclass the WrapperUtilities class.

Since:
IBM DB2 Information Integrator Version 8.2

Field Summary
static int EXT_WRAPPERS_TRACE_COMPONENT
          Trace component ID for wrappers not provided by IBM.
 
Method Summary
static int getAppCBStatus()
          Retrieve the status of the application control block.
static java.lang.String getAuthid()
          Retrieve the authorization ID for the current database.
static int getCodepage()
          Retrieve the current database code page.
static java.lang.String getDB2InstallPath()
          Retrieve the DB2 Universal Database installation path.
static java.lang.String getDB2InstancePath()
          Retrieve the DB2 Universal Database instance path.
static int getDB2Release()
          Get the DB2 Universal Database release and the fix pack that this wrapper is currently running under.
static int getDoubleByteDBCodepage()
          Retrieve the double-byte database code page.
static int getIsolationLevel()
          Retrieve the isolation level for the current database.
static int getSingleByteDBCodepage()
          Retrieve the single-byte database code page.
static void reportWarning(int sqlCode, java.lang.String funcName, java.lang.String[] tokens)
          Report a warning to the DB2 Information Integrator user.
static boolean traceEnabled()
          Verify whether the DB2 Information Integrator tracing is enabled.
static void traceError(int funcID, java.lang.String funcName, int probe, java.lang.String errorData)
          Trace an error message.
static void traceException(int funcID, java.lang.String funcName, int probe, java.lang.Throwable exception)
          Trace an exception and its call stack.
static void traceFunctionData(int funcID, java.lang.String funcName, int probe, java.lang.String data)
          Trace function data using a single data trace parameter.
static void traceFunctionData(int funcID, java.lang.String funcName, int probe, java.lang.String data1, java.lang.String data2)
          Trace function data using two data trace parameters.
static void traceFunctionData(int funcID, java.lang.String funcName, int probe, java.lang.String data1, java.lang.String data2, java.lang.String data3)
          Trace function data using three data trace parameters.
static void traceFunctionEntry(int funcID, java.lang.String funcName)
          Trace a function entry.
static void traceFunctionReturnCode(int funcID, java.lang.String funcName, int returnCode)
          Trace a function return code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXT_WRAPPERS_TRACE_COMPONENT

public static final int EXT_WRAPPERS_TRACE_COMPONENT
Trace component ID for wrappers not provided by IBM.

Since:
IBM DB2 Information Integrator Version 8.2
See Also:
Constant Field Values
Method Detail

getAppCBStatus

public static final int getAppCBStatus()
Retrieve the status of the application control block.

Returns:
The application control block status.
Since:
IBM DB2 Information Integrator Version 8.2

getAuthid

public static final java.lang.String getAuthid()
                                        throws WrapperException
Retrieve the authorization ID for the current database.

Returns:
The database authorization ID.
Throws:
WrapperException - if the operation fails.
Since:
IBM DB2 Information Integrator Version 8.2

getCodepage

public static final int getCodepage()
Retrieve the current database code page.

Returns:
The code page.
Since:
IBM DB2 Information Integrator Version 8.2

getDB2InstallPath

public static final java.lang.String getDB2InstallPath()
                                                throws WrapperException
Retrieve the DB2 Universal Database installation path.

Returns:
The DB2 Universal Database installation path.
Throws:
WrapperException - if the operation fails.
Since:
IBM DB2 Information Integrator Version 8.2

getDB2InstancePath

public static final java.lang.String getDB2InstancePath()
                                                 throws WrapperException
Retrieve the DB2 Universal Database instance path.

Returns:
The DB2 Universal Database instance path.
Throws:
WrapperException - if the operation fails.
Since:
IBM DB2 Information Integrator Version 8.2

getDB2Release

public static final int getDB2Release()
Get the DB2 Universal Database release and the fix pack that this wrapper is currently running under. This value will be updated at each DB2 Universal Database fix pack.

Returns:
The DB2 Universal Database release.
Since:
IBM DB2 Information Integrator Version 8.2

getDoubleByteDBCodepage

public static final int getDoubleByteDBCodepage()
Retrieve the double-byte database code page.

Returns:
The double-byte code page.
Since:
IBM DB2 Information Integrator Version 8.2

getIsolationLevel

public static final int getIsolationLevel()
Retrieve the isolation level for the current database.

Returns:
The isolation level.
Since:
IBM DB2 Information Integrator Version 8.2

getSingleByteDBCodepage

public static final int getSingleByteDBCodepage()
Retrieve the single-byte database code page.

Returns:
The single-byte code page.
Since:
IBM DB2 Information Integrator Version 8.2

reportWarning

public static final void reportWarning(int sqlCode,
                                       java.lang.String funcName,
                                       java.lang.String[] tokens)
                                throws WrapperException
Report a warning to the DB2 Information Integrator user. A DB2 Information Integrator warning is composed of a SQL code, the caller function name and a set of tokens. Each valid SQL code identifies a warning message. The message might contain placeholders which are replaced with the given tokens before the message is reported to the user.

Parameters:
sqlCode - The predefined SQL code of the warning that is reported.
funcName - The name of the function that reports the warning. The string cannot be greater than five characters. The client program can access this string value through the SQLERRP field of the SQLCA. The string value is in uppercase letters with a prefix of SQL.
tokens - The substitution tokens for the message.
Throws:
WrapperException - if the operation fails.

traceEnabled

public static final boolean traceEnabled()
Verify whether the DB2 Information Integrator tracing is enabled.

Returns:
true if tracing is enabled, false otherwise.
Since:
IBM DB2 Information Integrator Version 8.2

traceError

public static final void traceError(int funcID,
                                    java.lang.String funcName,
                                    int probe,
                                    java.lang.String errorData)
Trace an error message.

Parameters:
funcID - The trace ID of the caller function.
funcName - The name of the caller function.
probe - The probe ID.
errorData - The error data to trace.
Since:
IBM DB2 Information Integrator Version 8.2

traceException

public static final void traceException(int funcID,
                                        java.lang.String funcName,
                                        int probe,
                                        java.lang.Throwable exception)
Trace an exception and its call stack.

Parameters:
funcID - The trace ID of the caller function.
funcName - The name of the caller function.
probe - The probe ID.
exception - The exception to trace.
Since:
IBM DB2 Information Integrator Version 8.2

traceFunctionData

public static final void traceFunctionData(int funcID,
                                           java.lang.String funcName,
                                           int probe,
                                           java.lang.String data)
Trace function data using a single data trace parameter.

Parameters:
funcID - The trace ID of the caller function.
funcName - The name of the caller function.
probe - The probe ID.
data - The data to trace.
Since:
IBM DB2 Information Integrator Version 8.2

traceFunctionData

public static final void traceFunctionData(int funcID,
                                           java.lang.String funcName,
                                           int probe,
                                           java.lang.String data1,
                                           java.lang.String data2)
Trace function data using two data trace parameters.

Parameters:
funcID - The trace ID of the caller function.
funcName - The name of the caller function.
probe - The probe ID.
data1 - The first data to trace.
data2 - The second data to trace.
Since:
IBM DB2 Information Integrator Version 8.2

traceFunctionData

public static final void traceFunctionData(int funcID,
                                           java.lang.String funcName,
                                           int probe,
                                           java.lang.String data1,
                                           java.lang.String data2,
                                           java.lang.String data3)
Trace function data using three data trace parameters.

Parameters:
funcID - The trace ID of the caller function.
funcName - The name of the caller function.
probe - The probe ID.
data1 - The first data to trace.
data2 - The second data to trace.
data3 - The third data to trace.
Since:
IBM DB2 Information Integrator Version 8.2

traceFunctionEntry

public static final void traceFunctionEntry(int funcID,
                                            java.lang.String funcName)
Trace a function entry.

Parameters:
funcID - The trace ID of the caller function.
funcName - The name of the caller function.
Since:
IBM DB2 Information Integrator Version 8.2

traceFunctionReturnCode

public static final void traceFunctionReturnCode(int funcID,
                                                 java.lang.String funcName,
                                                 int returnCode)
Trace a function return code.

Parameters:
funcID - The trace ID of the caller function.
funcName - The name of the caller function.
returnCode - The return code.
Since:
IBM DB2 Information Integrator Version 8.2

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.