IBM DB2 Information Integrator
Java API Reference
for Developing Wrappers

com.ibm.db2.wrapper
Class RuntimeData

java.lang.Object
  extended bycom.ibm.db2.wrapper.Data
      extended bycom.ibm.db2.wrapper.RuntimeData

public final class RuntimeData
extends Data

The RuntimeData class represents each column value that is transferred between the federated server and a wrapper. A column value can be part of a result row being transferred from the wrapper to the federated server, or it can be a value to be bound to a runtime parameter in a query that is submitted to the wrapper by the federated server.

Since:
IBM DB2 Information Integrator Version 8.2

Field Summary
 
Fields inherited from class com.ibm.db2.wrapper.Data
BLOB, CHAR, CLOB, DATE, DECIMAL, DOUBLE, FLOAT, INT, LONG, NONE, SHORT, SQL_NO_NULLS, SQL_NULLABLE, SQL_NULLABLE_UNKNOWN, TIME, TIMESTAMP, VARCHAR
 
Method Summary
 boolean checkFriendlyDivBy0()
          Determine if the reason for a null indication is a divide by zero error.
 boolean checkFriendlyException()
          Determine if the reason for a null indication is a numeric exception.
 void clearNullIndicator()
          Clear the null indicator for the data value.
 int getActualLength()
          Retrieve the actual length for the data value.
 short getCodepage()
          Retrieve the code page for character data type values.
protected  byte[] getData()
          Retrieve the data value in an internal format.
 int getDataIndex()
          Retrieve the column number for the data value.
 short getDataType()
          Retrieve the data type.
 boolean getForBitData()
          Retrieve the FOR BIT DATA flag which indicates binary data.
 byte getInvariant()
          Retrieve the invariant value.
 int getMaximumLength()
          Retrieve the maximum length of the data.
 java.lang.String getName()
          Retrieve the name for the data.
 short getNullIndicator()
          Retrieve the null indicator for the data value.
 byte getPrecision()
          Retrieve the precision for numeric data type values.
 int getRemoteLength()
          Retrieve the remote length of the data value.
 byte getRemotePrecision()
          Retrieve the remote precision for the numeric data type values.
 byte getRemoteScale()
          Retrieve the remote scale of the numeric data type values.
 short getRemoteType()
          Retrieve the remote type of the data value.
 byte getScale()
          Retrieve the scale for numeric data type values.
 boolean isDataNull()
          Indicate whether the data value is null.
 boolean isDataNullable()
          Indicate whether the data value is nullable.
 boolean isSemanticNull()
          Indicate whether the data value is semantic null.
 void setActualLength(int length)
          Set the actual length for the data value.
 void setBigDecimal(java.math.BigDecimal value)
          Set the data value as a BigDecimal instance.
 void setBinary(byte[] value)
          Set the data value as a binary value.
 void setByte(byte value)
          Set the data value as a byte.
 void setDataNull()
          Mark the data value as null.
 void setDate(java.sql.Date value)
          Set the data value as a Date instance.
 void setDouble(double value)
          Set the data value as a double.
 void setFloat(float value)
          Set the data value as a float.
 void setFriendlyDivBy0()
          Indicate that a value is null because a divide by zero error occurred.
 void setFriendlyException()
          Indicate that a value is null because of a numeric exception.
 void setInt(int value)
          Set the data value as an int.
 void setLong(long value)
          Set the data value as a long.
 void setNullIndicator(short indicator)
          Set the null indicator for the data value.
 void setObject(java.lang.Object value)
          Set the data value as an Object instance.
 void setPrecision(byte precision)
          Set the precision for numeric data type values.
 void setScale(byte scale)
          Set the scale for numeric data type values.
 void setShort(short value)
          Set the data value as a short.
 void setString(java.lang.String value)
          Set the data value as a string.
 void setTime(java.sql.Time value)
          Set the data value as a Time instance.
 void setTimestamp(java.sql.Timestamp value)
          Set the data value as a Timestamp instance.
 
Methods inherited from class com.ibm.db2.wrapper.Data
getBigDecimal, getByte, getDate, getDouble, getFloat, getInt, getLong, getObject, getShort, getString, getTime, getTimestamp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

checkFriendlyDivBy0

public boolean checkFriendlyDivBy0()
Determine if the reason for a null indication is a divide by zero error.

Returns:
true if divide by zero error occurred, false otherwise.
Since:
IBM DB2 Information Integrator Version 8.2

checkFriendlyException

public boolean checkFriendlyException()
Determine if the reason for a null indication is a numeric exception.

Returns:
true if numeric exception occurred, false otherwise.
Since:
IBM DB2 Information Integrator Version 8.2

clearNullIndicator

public void clearNullIndicator()
                        throws WrapperException
Clear the null indicator for the data value.

Throws:
WrapperException - if the operation fails.
Since:
IBM DB2 Information Integrator Version 8.2

getActualLength

public int getActualLength()
Retrieve the actual length for the data value.

Returns:
The actual length.
Since:
IBM DB2 Information Integrator Version 8.2

getCodepage

public short getCodepage()
Retrieve the code page for character data type values.

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

getData

protected byte[] getData()
                  throws WrapperException
Retrieve the data value in an internal format.

Specified by:
getData in class Data
Returns:
The data in an internal format.
Throws:
WrapperException - - if the processing fails.
Since:
IBM DB2 Information Integrator Version 8.2

getDataIndex

public int getDataIndex()
Retrieve the column number for the data value.

Returns:
The column number.
Since:
IBM DB2 Information Integrator Version 8.2

getDataType

public short getDataType()
Retrieve the data type.

Specified by:
getDataType in class Data
Returns:
The data type.
Since:
IBM DB2 Information Integrator Version 8.2

getForBitData

public boolean getForBitData()
Retrieve the FOR BIT DATA flag which indicates binary data.

Specified by:
getForBitData in class Data
Returns:
The FOR BIT DATA flag.
Since:
IBM DB2 Information Integrator Version 8.2

getInvariant

public byte getInvariant()
Retrieve the invariant value. The value of an invariant parameter will not change unless the wrapper is notified via the "action" parameter of the RemoteQuery.reopen(short) method.

Returns:
The invariant value.
Since:
IBM DB2 Information Integrator Version 8.2

getMaximumLength

public int getMaximumLength()
Retrieve the maximum length of the data.

Returns:
The maximum length.
Since:
IBM DB2 Information Integrator Version 8.2

getName

public java.lang.String getName()
Retrieve the name for the data.

Returns:
The name.
Since:
IBM DB2 Information Integrator Version 8.2

getNullIndicator

public short getNullIndicator()
Retrieve the null indicator for the data value.

Returns:
The null indicator which is Data.SQL_NULLABLE or Data.SQL_NO_NULLS
Since:
IBM DB2 Information Integrator Version 8.2

getPrecision

public byte getPrecision()
Retrieve the precision for numeric data type values.

Returns:
The precision.
Since:
IBM DB2 Information Integrator Version 8.2

getRemoteLength

public int getRemoteLength()
Retrieve the remote length of the data value.

Returns:
The remote length.
Since:
IBM DB2 Information Integrator Version 8.2

getRemotePrecision

public byte getRemotePrecision()
Retrieve the remote precision for the numeric data type values.

Returns:
The remote precision.
Since:
IBM DB2 Information Integrator Version 8.2

getRemoteScale

public byte getRemoteScale()
Retrieve the remote scale of the numeric data type values.

Returns:
The remote scale.
Since:
IBM DB2 Information Integrator Version 8.2

getRemoteType

public short getRemoteType()
Retrieve the remote type of the data value.

Returns:
The remote type.
Since:
IBM DB2 Information Integrator Version 8.2

getScale

public byte getScale()
Retrieve the scale for numeric data type values.

Returns:
The scale.
Since:
IBM DB2 Information Integrator Version 8.2

isDataNull

public boolean isDataNull()
Indicate whether the data value is null.

Returns:
true if the data is null, false otherwise.
Since:
IBM DB2 Information Integrator Version 8.2

isDataNullable

public boolean isDataNullable()
Indicate whether the data value is nullable.

Returns:
true if the data is nullable, false otherwise.
Since:
IBM DB2 Information Integrator Version 8.2

isSemanticNull

public boolean isSemanticNull()
Indicate whether the data value is semantic null.

Returns:
true if the data is semantic null, false otherwise.
Since:
IBM DB2 Information Integrator Version 8.2

setActualLength

public void setActualLength(int length)
Set the actual length for the data value.

Parameters:
length - The actual length.
Since:
IBM DB2 Information Integrator Version 8.2

setBigDecimal

public void setBigDecimal(java.math.BigDecimal value)
                   throws WrapperException
Set the data value as a BigDecimal instance.

Parameters:
value - The data value.
Throws:
WrapperException - if the data type is not compatible.
Since:
IBM DB2 Information Integrator Version 8.2

setBinary

public void setBinary(byte[] value)
               throws WrapperException
Set the data value as a binary value.

Parameters:
value - The data value.
Throws:
WrapperException - if the data type is not compatible.
Since:
IBM DB2 Information Integrator Version 8.2

setByte

public void setByte(byte value)
             throws WrapperException
Set the data value as a byte.

Parameters:
value - The data value.
Throws:
WrapperException - if the data type is not compatible.
Since:
IBM DB2 Information Integrator Version 8.2

setDataNull

public void setDataNull()
                 throws WrapperException
Mark the data value as null.

Throws:
WrapperException - if data cannot be null.
Since:
IBM DB2 Information Integrator Version 8.2

setDate

public void setDate(java.sql.Date value)
             throws WrapperException
Set the data value as a Date instance.

Parameters:
value - The data value.
Throws:
WrapperException - if the data type is not compatible.
Since:
IBM DB2 Information Integrator Version 8.2

setDouble

public void setDouble(double value)
               throws WrapperException
Set the data value as a double.

Parameters:
value - The data value.
Throws:
WrapperException - if the data type is not compatible.
Since:
IBM DB2 Information Integrator Version 8.2

setFloat

public void setFloat(float value)
              throws WrapperException
Set the data value as a float.

Parameters:
value - The data value.
Throws:
WrapperException - if the data type is not compatible.
Since:
IBM DB2 Information Integrator Version 8.2

setFriendlyDivBy0

public void setFriendlyDivBy0()
                       throws WrapperException
Indicate that a value is null because a divide by zero error occurred. The wrapper should call setDataNull() before.

Throws:
WrapperException - if the operation fails.
Since:
IBM DB2 Information Integrator Version 8.2

setFriendlyException

public void setFriendlyException()
                          throws WrapperException
Indicate that a value is null because of a numeric exception. The wrapper should call setDataNull() before.

Throws:
WrapperException - if the operation fails.
Since:
IBM DB2 Information Integrator Version 8.2

setInt

public void setInt(int value)
            throws WrapperException
Set the data value as an int.

Parameters:
value - The data value.
Throws:
WrapperException - if the data type is not compatible.
Since:
IBM DB2 Information Integrator Version 8.2

setLong

public void setLong(long value)
             throws WrapperException
Set the data value as a long.

Parameters:
value - The data value.
Throws:
WrapperException - if the data type is not compatible.
Since:
IBM DB2 Information Integrator Version 8.2

setNullIndicator

public void setNullIndicator(short indicator)
Set the null indicator for the data value.

Parameters:
indicator - The null indicator.
Since:
IBM DB2 Information Integrator Version 8.2

setObject

public void setObject(java.lang.Object value)
               throws WrapperException
Set the data value as an Object instance.

Parameters:
value - The data value.
Throws:
WrapperException - if the data type is not compatible.
Since:
IBM DB2 Information Integrator Version 8.2

setPrecision

public void setPrecision(byte precision)
Set the precision for numeric data type values.

Parameters:
precision - The precision.
Since:
IBM DB2 Information Integrator Version 8.2

setScale

public void setScale(byte scale)
Set the scale for numeric data type values.

Parameters:
scale - The scale.
Since:
IBM DB2 Information Integrator Version 8.2

setShort

public void setShort(short value)
              throws WrapperException
Set the data value as a short.

Parameters:
value - The data value.
Throws:
WrapperException - if the data type is not compatible.
Since:
IBM DB2 Information Integrator Version 8.2

setString

public void setString(java.lang.String value)
               throws WrapperException
Set the data value as a string.

Parameters:
value - The data value.
Throws:
WrapperException - if the data type is not compatible.
Since:
IBM DB2 Information Integrator Version 8.2

setTime

public void setTime(java.sql.Time value)
             throws WrapperException
Set the data value as a Time instance.

Parameters:
value - The data value.
Throws:
WrapperException - if the data type is not compatible.
Since:
IBM DB2 Information Integrator Version 8.2

setTimestamp

public void setTimestamp(java.sql.Timestamp value)
                  throws WrapperException
Set the data value as a Timestamp instance.

Parameters:
value - The data value.
Throws:
WrapperException - if the data type is not compatible.
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.