Top Description Inners Fields Constructors Methods
org.apache.derby.iapi.types

public Class SQLClob

extends SQLVarchar
Class Inheritance
Known Direct Subclasses
org.apache.derby.iapi.types.CollatorSQLClob
Imports
org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.jdbc.CharacterStreamDescriptor, org.apache.derby.iapi.services.io.ArrayInputStream, .CloneableStream, .FormatIdInputStream, .InputStreamUtil, .StoredFormatIds, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.util.UTF8Util, org.apache.derby.shared.common.reference.SQLState, java.io.IOException, .InputStream, .ObjectInput, .ObjectOutput, .PushbackInputStream, java.math.BigDecimal, java.sql.Clob, .Date, .SQLException, .Time, .Timestamp, java.text.RuleBasedCollator, java.util.Calendar

SQLClob represents a CLOB value with UCS_BASIC collation. CLOB supports LIKE operator only for collation.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
SQLClob.HeaderInfo

Holder class for header information gathered from the raw byte header in the stream.

Field Summary

Modifier and TypeField and Description
private CharacterStreamDescriptor
csd

The descriptor for the stream.

private Boolean
inSoftUpgradeMode

Tells if the database is being accessed in soft upgrade mode.

private static final int
MAX_STREAM_HEADER_LENGTH

The maximum number of bytes used by the stream header.

private static final StreamHeaderGenerator
TEN_FIVE_CLOB_HEADER_GENERATOR

The header generator used for 10.5 databases.

private static final StreamHeaderGenerator
TEN_FOUR_CLOB_HEADER_GENERATOR

The header generator used for 10.4 (or older) databases.

Constructor Summary

AccessConstructor and Description
public
public
public

Method Summary

Modifier and TypeMethod and Description
public DataValueDescriptor

Returns:

A clone of this CLOB value.
cloneValue
(boolean
any streams representing the data value will be materialized if true, the data value will be kept as a stream if possible if false
forceMaterialization
)

Overrides org.apache.derby.iapi.types.SQLVarchar.cloneValue.

Implements org.apache.derby.iapi.types.DataValueDescriptor.cloneValue.

Returns a clone of this CLOB value.

public boolean
public byte
public byte[]
getBytes()

Overrides org.apache.derby.iapi.types.DataType.getBytes.

Implements org.apache.derby.iapi.types.DataValueDescriptor.getBytes.

Gets the value in the data value descriptor as a byte array.

public Date
getDate(Calendar
calendar for object creation
cal
)

Overrides org.apache.derby.iapi.types.SQLChar.getDate.

Implements org.apache.derby.iapi.types.DataValueDescriptor.getDate.

Get date from a SQLChar.

public double
public float
public int
public int

Returns:

The character length of this Clob.
getLength
()

Overrides org.apache.derby.iapi.types.SQLChar.getLength.

Implements org.apache.derby.iapi.types.DataValueDescriptor.getLength.

Returns the character length of this Clob.

public long
public DataValueDescriptor
getNewNull()

Overrides org.apache.derby.iapi.types.SQLVarchar.getNewNull.

Implements org.apache.derby.iapi.types.DataValueDescriptor.getNewNull.

Get a new null value of the same type as this data value.

public Object
getObject()

Overrides org.apache.derby.iapi.types.SQLChar.getObject.

Implements org.apache.derby.iapi.types.DataValueDescriptor.getObject.

Gets the value in the data value descriptor as a Java Object.

public short
public StreamHeaderGenerator

Returns:

A stream header generator.
getStreamHeaderGenerator
()

Overrides org.apache.derby.iapi.types.SQLChar.getStreamHeaderGenerator.

Implements org.apache.derby.iapi.types.StringDataValue.getStreamHeaderGenerator.

Returns a stream header generator for a Clob.

public CharacterStreamDescriptor

Returns:

A descriptor for the stream, which includes a reference to the stream itself. If the value cannot be represented as a stream, null is returned instead of a descriptor.
getStreamWithDescriptor
()

Overrides org.apache.derby.iapi.types.SQLChar.getStreamWithDescriptor.

Implements org.apache.derby.iapi.types.StringDataValue.getStreamWithDescriptor.

Returns a descriptor for the input stream for this CLOB value.

public Time
getTime(Calendar
calendar for object creation
cal
)

Overrides org.apache.derby.iapi.types.SQLChar.getTime.

Implements org.apache.derby.iapi.types.DataValueDescriptor.getTime.

Get time from a SQLChar.

public Timestamp
getTimestamp(Calendar
calendar for object creation
cal
)

Overrides org.apache.derby.iapi.types.SQLChar.getTimestamp.

Implements org.apache.derby.iapi.types.DataValueDescriptor.getTimestamp.

Get Timestamp from a SQLChar.

public final String

Returns:

a trace representation of the CLOB.
getTraceString
()

Overrides org.apache.derby.iapi.types.SQLChar.getTraceString.

Implements org.apache.derby.iapi.types.DataValueDescriptor.getTraceString.

Gets a trace representation of the CLOB for debugging.

public int
public String
public StringDataValue
getValue(RuleBasedCollator collatorForComparison)

Overrides org.apache.derby.iapi.types.SQLVarchar.getValue.

Implements org.apache.derby.iapi.types.StringDataValue.getValue.

Gets either SQLChar/SQLVarchar/SQLLongvarchar/SQLClob(base classes) or CollatorSQLChar/CollatorSQLVarchar/CollatorSQLLongvarch/CollatorSQLClob (subclasses).

public boolean

Returns:

true if the value is represented by a stream, false otherwise.
hasStream
()

Overrides org.apache.derby.iapi.types.DataType.hasStream.

Implements org.apache.derby.iapi.types.DataValueDescriptor.hasStream.

Tells if this CLOB value is, or will be, represented by a stream.

private SQLClob.HeaderInfo

Returns:

The information obtained from the header.
investigateHeader
(byte[]
the raw header bytes
hdr
,
int
number of bytes written into the raw header bytes array
bytesRead
)

Investigates the header and returns length information.

public void
normalize(DataTypeDescriptor
The type to normalize the source column to
desiredType
,
DataValueDescriptor
The value to normalize
sourceValue
)

Overrides org.apache.derby.iapi.types.SQLVarchar.normalize.

Implements org.apache.derby.iapi.types.DataValueDescriptor.normalize.

Normalization method - this method may be called when putting a value into a SQLClob, for example, when inserting into a SQLClob column.

public void
readExternal(ObjectInput
source stream
in
)

Overrides org.apache.derby.iapi.types.SQLChar.readExternal.

Implements java.io.Externalizable.readExternal.

Reads and materializes the CLOB value from the stream.

public void
public final void
private void
rewindStream(InputStream
input stream to rewind
in
,
long
number of bytes to skip
offset
)

Rewinds the stream to the beginning and then skips the specified number of bytes.

public void
setBigDecimal(BigDecimal
required to be a BigDecimal or null.
bigDecimal
)

Overrides org.apache.derby.iapi.types.SQLChar.setBigDecimal.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setBigDecimal.

Only to be called when an application through JDBC is setting a SQLChar to a java.math.BigDecimal.

pack-priv final void
setObject(Object theValue)

Overrides org.apache.derby.iapi.types.DataType.setObject.

Set the value from an non-null Java.sql.Clob object.

public final void
public void
setStreamHeaderFormat(Boolean
TRUE if the database is accessed in soft upgrade mode, FALSE is not, or null if unknown
inSoftUpgradeMode
)

Overrides org.apache.derby.iapi.types.SQLChar.setStreamHeaderFormat.

Implements org.apache.derby.iapi.types.StringDataValue.setStreamHeaderFormat.

Tells whether the database is being accessed in soft upgrade mode or not.

public void
setValue(Time
The Time value to set this DataValueDescriptor to
theValue
,
Calendar
The time zone from the calendar is used to construct the database time value
cal
)

Overrides org.apache.derby.iapi.types.SQLChar.setValue.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value of this DataValueDescriptor.

public void
setValue(Timestamp
The Timestamp value to set this DataValueDescriptor to
theValue
,
Calendar
The time zone from the calendar is used to construct the database timestamp value
cal
)

Overrides org.apache.derby.iapi.types.SQLChar.setValue.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value of this DataValueDescriptor.

public void
setValue(Date
The Date value to set this DataValueDescriptor to
theValue
,
Calendar
The time zone from the calendar is used to construct the database date value
cal
)

Overrides org.apache.derby.iapi.types.SQLChar.setValue.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value of this DataValueDescriptor.

public void
setValue(int
The value to set this DataValueDescriptor to
theValue
)

Overrides org.apache.derby.iapi.types.SQLChar.setValue.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value of this DataValueDescriptor to the given int value

public void
setValue(double
The value to set this DataValueDescriptor to
theValue
)

Overrides org.apache.derby.iapi.types.SQLChar.setValue.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setValue.

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
)

Overrides org.apache.derby.iapi.types.SQLChar.setValue.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value of this DataValueDescriptor to the given double value

public void
setValue(short
The value to set this DataValueDescriptor to
theValue
)

Overrides org.apache.derby.iapi.types.SQLChar.setValue.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value of this DataValueDescriptor to the given short value

public void
setValue(long
The value to set this DataValueDescriptor to
theValue
)

Overrides org.apache.derby.iapi.types.SQLChar.setValue.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value of this DataValueDescriptor to the given long value

public void
setValue(byte
The value to set this DataValueDescriptor to
theValue
)

Overrides org.apache.derby.iapi.types.SQLChar.setValue.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value of this DataValueDescriptor to the given byte value

public void
setValue(boolean
Contains the boolean value to set this to
theValue
)

Overrides org.apache.derby.iapi.types.SQLChar.setValue.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value.

public void
setValue(byte[]
The byte value to set this DataValueDescriptor to
theValue
)

Overrides org.apache.derby.iapi.types.SQLChar.setValue.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value of this DataValueDescriptor.

public int
public int
public void
writeExternal(ObjectOutput
destination stream
out
)

Overrides org.apache.derby.iapi.types.SQLChar.writeExternal.

Implements java.io.Externalizable.writeExternal.

Writes the CLOB data value to the given destination stream using the modified UTF-8 format.

Inherited from org.apache.derby.iapi.types.SQLVarchar:
growBynormalize