This interface matches the getXXX methods on java.sql.ResultSet. This means everyone satisfies getString and getObject; all of the numeric types, within the limits of representation, satisfy all of the numeric getXXX methods; all of the character types satisfy all of the getXXX methods except getBytes and getBinaryStream; all of the binary types satisfy getBytes and all of the getXXXStream methods; Date satisfies getDate and getTimestamp; Time satisfies getTime; and Timestamp satisfies all of the date/time getXXX methods. The "preferred" method (one that will always work, I presume) is the one that matches the type most closely. See the comments below for "preferences". See the JDBC guide for details.
This interface does not include the getXXXStream methods.
The preferred methods for JDBC are:
CHAR and VARCHAR - getString()
BIT - getBoolean()
TINYINT - getByte()
SMALLINT - getShort()
INTEGER - getInt()
BIGINT - getLong()
REAL - getFloat()
FLOAT and DOUBLE - getDouble()
DECIMAL and NUMERIC - getBigDecimal()
BINARY and VARBINARY - getBytes()
DATE - getDate()
TIME - getTime()
TIMESTAMP - getTimestamp()
No JDBC type corresponds to getObject(). Use this for user-defined types or to get the JDBC types as java Objects. All primitive types will be wrapped in their corresponding Object type, i.e. int will be wrapped in an Integer.
getStream()
| Modifier and Type | Field and Description |
|---|---|
| public static final int | UNKNOWN_LOGICAL_LENGTH
Constant indicating that the logical length of a value (i.e. chars for string types or bytes for binary types) is unknown. |
| Modifier and Type | Method and Description |
|---|---|
| public void | checkHostVariable(int declaredLength)
Check the value to seem if it conforms to the restrictions imposed by DB2/JCC on host variables for this type. |
| public DataValueDescriptor | Returns: A clone of this descriptor, which shares the internal state.Get a shallow copy of this |
| public DataValueDescriptor | Returns: A clone of theDataValueDescriptor with the same initial
value as this.any streams representing the data value will
be materialized if forceMaterialization)true, the data value will be kept as a
stream if possible if falseClone this DataValueDescriptor. |
| public DataValueDescriptor | Returns: A DataValueDescriptor which will be either null or first non-null argumentThe list of the arguments. Function will return the first non-nullable argument if any. list, DataValueDescriptor The return value is the correct datatype for this function.
The return value of this method is the type of the 2nd parameter. returnValue)The SQL language COALESCE/VALUE function. |
| public int | Returns: <0 - this Orderable is less than other. 0 - this Orderable equals other. >0 - this Orderable is greater than other. The code should not explicitly look for -1, or 1.The Orderable to compare this one to. other)Compare this Orderable with a given Orderable for the purpose of index positioning. |
| public int | Returns: <0 - this Orderable is less than other. 0 - this Orderable equals other. >0 - this Orderable is greater than other. The code should not explicitly look for -1, or 1.The Orderable to compare this one to.
% @param nullsOrderedLow True if null should be lower than non-NULL other, boolean nullsOrderedLow)Compare this Orderable with another, with configurable null ordering. |
| public boolean | Returns: true if the comparison is true (duh!)Orderable.ORDER_OP_EQUALS means do an = comparison.
Orderable.ORDER_OP_LESSTHAN means compare this < other.
Orderable.ORDER_OP_LESSOREQUALS means compare this <= other. op, DataValueDescriptor The DataValueDescriptor to compare this one to. other, boolean True means to treat nulls as ordered values,
that is, treat SQL null as equal to null, and less
than all other values.
False means to treat nulls as unknown values,
that is, the result of any comparison with a null
is the UNKNOWN truth value. orderedNulls, boolean The return value to use if the result of the
comparison is the UNKNOWN truth value. In other
words, if orderedNulls is false, and a null is
involved in the comparison, return unknownRV.
This parameter is not used orderedNulls is true. unknownRV)Compare this Orderable with a given Orderable for the purpose of qualification and sorting. |
| public boolean | Returns: true if the comparison is true (duh!)Orderable.ORDER_OP_EQUALS means do an = comparison.
Orderable.ORDER_OP_LESSTHAN means compare this < other.
Orderable.ORDER_OP_LESSOREQUALS means compare this <= other. op, DataValueDescriptor The DataValueDescriptor to compare this one to. other, boolean True means to treat nulls as ordered values,
that is, treat SQL null as equal to null, and either greater or less
than all other values.
False means to treat nulls as unknown values,
that is, the result of any comparison with a null
is the UNKNOWN truth value. orderedNulls, boolean True means NULL less than non-NULL,
false means NULL greater than non-NULL.
Only relevant if orderedNulls is true. nullsOrderedLow, boolean The return value to use if the result of the
comparison is the UNKNOWN truth value. In other
words, if orderedNulls is false, and a null is
involved in the comparison, return unknownRV.
This parameter is not used orderedNulls is true. unknownRV)Compare this Orderable with another, with configurable null ordering. |
| public BooleanDataValue | Returns: A BooleanDataValue telling the result of the comparisonThe value on the left side of the operator left, DataValueDescriptor The value on the right side of the operator right)The SQL language = operator. |
| public int | Returns: the estimated memory usageEstimate the memory usage in bytes of the data value and the overhead of the class. |
| public boolean | Returns: The data value as a boolean.Gets the value in the data value descriptor as a boolean. |
| public byte | |
| public byte[] | Returns: The data value as a byte[].Gets the value in the data value descriptor as a byte array. |
| public Date | |
| public double | Returns: The data value as a double.Gets the value in the data value descriptor as a double. |
| public float | Returns: The data value as a float.Gets the value in the data value descriptor as a float. |
| public int | |
| public int | |
| public long | |
| public DataValueDescriptor | |
| public Object | Returns: The data value as an Object.Gets the value in the data value descriptor as a Java Object. |
| public short | Returns: The data value as a short.Gets the value in the data value descriptor as a short. |
| public InputStream | Returns: The stream state of the data value.Gets the value in the data value descriptor as a stream of bytes. |
| public String | Returns: The data value as a String.Gets the value in the data value descriptor as a String. |
| public Time | |
| public Timestamp | Returns: The data value as a java.sql.Timestamp.calendar for object creation cal)Gets the value in the data value descriptor as a java.sql.Timestamp. |
| public String | |
| public String | |
| public BooleanDataValue | Returns: A BooleanDataValue telling the result of the comparisonThe value on the left side of the operator left, DataValueDescriptor The value on the right side of the operator right)The SQL language >= operator. |
| public BooleanDataValue | Returns: A BooleanDataValue telling the result of the comparisonThe value on the left side of the operator left, DataValueDescriptor The value on the right side of the operator right)The SQL language > operator. |
| public boolean | Returns: true if the value will be a stream, false
otherwise.Tells if this data value is, or will be, represented by a stream. |
| public BooleanDataValue | Returns: A BooleanDataValue telling the result of the comparisonThe value on the left side of the operator left, DataValueDescriptor[] The values in the IN list inList, boolean True means that the values in the IN list are ordered,
false means they are not. orderedList)The SQL language IN operator. |
| public BooleanDataValue | |
| public BooleanDataValue | |
| public BooleanDataValue | Returns: A BooleanDataValue telling the result of the comparisonThe value on the left side of the operator left, DataValueDescriptor The value on the right side of the operator right)The SQL language <= operator. |
| public BooleanDataValue | Returns: A BooleanDataValue telling the result of the comparisonThe value on the left side of the operator left, DataValueDescriptor The value on the right side of the operator right)The SQL language < operator. |
| public void | normalize(DataTypeDescriptor dtd, DataValueDescriptor source)
Normalize the source value to this type described by this class and the passed in DataTypeDescriptor. |
| public BooleanDataValue | Returns: A BooleanDataValue telling the result of the comparisonThe value on the left side of the operator left, DataValueDescriptor The value on the right side of the operator right)The SQL language <> operator. |
| public void | readExternalFromArray(ArrayInputStream
The array stream positioned at the beginning of the
byte stream to read from. ais)Read the DataValueDescriptor from the stream. |
| public DataValueDescriptor | Returns: this object with the value set to null, or a new DataValueDescriptor of the same type as thisRecycle this DataValueDescriptor if possible. |
| public void | setBigDecimal(BigDecimal
required to be a BigDecimal or null. bigDecimal)Set this value from an application supplied java.math.BigDecimal. |
| public void | |
| public void | |
| public void | setObjectForCast(Object
The new value value, boolean Whether or not the new value
is an instanceof the result type. instanceOfResultType, String The class name of the resulting (declared) type
(for error messages only). resultTypeClassName)Set this value from an Object. |
| public void | |
| public void | setValue(int
The value to set this DataValueDescriptor to theValue)Set the value of this DataValueDescriptor to the given int value |
| public void | setValue(double
The value to set this DataValueDescriptor to theValue)Set the value of this DataValueDescriptor to the given double value |
| public void | setValue(float
A Double containing the value to set this
DataValueDescriptor to. Null means set the value
to SQL null. theValue)Set the value of this DataValueDescriptor to the given double value |
| public void | setValue(short
The value to set this DataValueDescriptor to theValue)Set the value of this DataValueDescriptor to the given short value |
| public void | setValue(long
The value to set this DataValueDescriptor to theValue)Set the value of this DataValueDescriptor to the given long value |
| public void | setValue(byte
The value to set this DataValueDescriptor to theValue)Set the value of this DataValueDescriptor to the given byte value |
| public void | |
| public void | |
| public void | setValue(byte[]
The byte value to set this DataValueDescriptor to theValue)Set the value of this DataValueDescriptor. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | setValue(DataValueDescriptor
The Date value to set this DataValueDescriptor to theValue)Set the value of this DataValueDescriptor from another. |
| public void | setValue(InputStream
stream of correctly formatted data theStream, int logical length of the stream's value in units of this
type (e.g. chars for string types), or
valueLength)UNKNOWN_LOGICAL_LENGTH if the logical length is unknownSet the value to be the contents of the stream. |
| public void | setValueFromResultSet(ResultSet
The specified ResultSet. resultSet, int The 1-based column # into the resultSet. colNumber, boolean Whether or not the column is nullable
(No need to call wasNull() if not) isNullable)Set the value based on the value for the specified DataValueDescriptor from the specified ResultSet. |
| public int | |
| public int | Returns: Types.CHAR for String conversion through getString Types.DECIMAL for BigDecimal through getObject or Types.BIGINT for long conversion through getLongHow should this value be obtained so that it can be converted to a BigDecimal representation. |