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

public final Class DataValueFactoryImpl

extends Object
implements DataValueFactory, ModuleControl
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.services.monitor.ModuleControl, org.apache.derby.iapi.types.DataValueFactory
Imports
org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.shared.common.i18n.LocaleFinder, org.apache.derby.iapi.services.io.StoredFormatIds, org.apache.derby.iapi.services.monitor.ModuleControl, .ModuleFactory, .Monitor, org.apache.derby.shared.common.reference.Attribute, .SQLState, java.sql.Blob, .Clob, .Date, .Time, .Timestamp, java.text.Collator, .RuleBasedCollator, java.util.Properties, .Locale, org.apache.derby.iapi.db.DatabaseContext, org.apache.derby.iapi.services.context.Context, .ContextService

Core implementation of DataValueFactory.
See Also
DataValueFactory

Field Summary

Modifier and TypeField and Description
private RuleBasedCollator
private Locale
private LocaleFinder

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
boot(boolean
True if the database should be created
create
,
Properties
Configuration properties
properties
)

Implements org.apache.derby.iapi.services.monitor.ModuleControl.boot.

Boot this module with the given properties.

public BitDataValue
getBitDataValue(byte[] value)

Implements org.apache.derby.iapi.types.DataValueFactory.getBitDataValue.

Get a SQL bit with the given value.

public BitDataValue
public BitDataValue
getBlobDataValue(byte[] value, BitDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getBlobDataValue.

Get a SQL Blob with the given value.

public BitDataValue
getBlobDataValue(Blob value, BitDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getBlobDataValue.

Get a SQL Blob with the given value.

public RuleBasedCollator
getCharacterCollator(int
This will be UCS_BASIC or TERRITORY_BASED
collationType
)

Implements org.apache.derby.iapi.types.DataValueFactory.getCharacterCollator.

Return the RuleBasedCollator depending on the collation type.

public StringDataValue
getCharDataValue(String value)

Implements org.apache.derby.iapi.types.DataValueFactory.getCharDataValue.

Get a new SQLChar object to represent a SQL CHAR (UCS_BASIC) with the given value.

public StringDataValue
getCharDataValue(String value, StringDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getCharDataValue.

Get a SQLChar object to represent a SQL CHAR (UCS_BASIC with the given value.

public StringDataValue
getCharDataValue(String value, StringDataValue previous, int collationType)

Implements org.apache.derby.iapi.types.DataValueFactory.getCharDataValue.

Return a StringDataValue to represent a SQL CHAR with the given collation re-using previous if not null.

public StringDataValue
getClobDataValue(String value, StringDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getClobDataValue.

Get a SQLClob object to represent a SQL CLOB (UCS_BASIC) with the given value.

public StringDataValue
getClobDataValue(Clob value, StringDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getClobDataValue.

Get a SQLClob object to represent a SQL CLOB (UCS_BASIC) with the given value.

public StringDataValue
getClobDataValue(Clob value, StringDataValue previous, int collationType)

Implements org.apache.derby.iapi.types.DataValueFactory.getClobDataValue.

Get a StringDataValue to represent a SQL CLOB with the passed in collationType.

public StringDataValue
getClobDataValue(String value, StringDataValue previous, int collationType)

Implements org.apache.derby.iapi.types.DataValueFactory.getClobDataValue.

Return a StringDataValue to represent a SQL CLOB with the given collation re-using previous if not null.

pack-priv static Context
getContext(final String contextID)

Package protected so that user code can't call this entry point.

public NumberDataValue
getDataValue(int value, NumberDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getDataValue.

Get a SQL int with the given value.

public NumberDataValue
getDataValue(Integer value, NumberDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getDataValue.

Get a SQL int with the given value.

public NumberDataValue
getDataValue(char value, NumberDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getDataValue.

Get a SQL int with a char value.

public NumberDataValue
getDataValue(short value, NumberDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getDataValue.

Get a SQL SMALLINT with the given value.

public NumberDataValue
getDataValue(Short value, NumberDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getDataValue.

Get a SQL smallint with the given value.

public NumberDataValue
getDataValue(byte value, NumberDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getDataValue.

Get a SQL TINYINT with the given value.

public NumberDataValue
getDataValue(Byte value, NumberDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getDataValue.

Get a SQL TINYINT with the given value.

public NumberDataValue
getDataValue(long value, NumberDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getDataValue.

Get a SQL bigint with the given value.

public NumberDataValue
getDataValue(Long value, NumberDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getDataValue.

Get a SQL bigint with the given value.

public NumberDataValue
getDataValue(float value, NumberDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getDataValue.

Get a SQL real with the given value.

public NumberDataValue
getDataValue(Float value, NumberDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getDataValue.

Get a SQL real with the given value.

public NumberDataValue
getDataValue(double value, NumberDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getDataValue.

Get a SQL double precision with the given value.

public NumberDataValue
getDataValue(Double value, NumberDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getDataValue.

Get a SQL double precision with the given value.

public BooleanDataValue
getDataValue(boolean value, BooleanDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getDataValue.

Get a SQL boolean with the given value.

public BooleanDataValue
getDataValue(Boolean value, BooleanDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getDataValue.

Get a SQL boolean with the given value.

public DateTimeDataValue
getDataValue(Date value, DateTimeDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getDataValue.

Get a SQL date with the given value.

public DateTimeDataValue
getDataValue(Time value, DateTimeDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getDataValue.

Get a SQL time with the given value.

public DateTimeDataValue
getDataValue(Timestamp value, DateTimeDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getDataValue.

Get a SQL timestamp with the given value.

public UserDataValue
getDataValue(Object value, UserDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getDataValue.

Get a User-defined data value with the given value and type name.

public RefDataValue
getDataValue(RowLocation value, RefDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getDataValue.

Get a RefDataValue with the given value.

public DateTimeDataValue
getDate(DataValueDescriptor
Must be a date, a number, or a string convertible to a date.
operand
)

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

Implement the date SQL function: construct a SQL date from a string, number, or timestamp.

public DateTimeDataValue
getDateValue(String
A date in one of the DB2 standard date formats or the local format.
dateStr
,
boolean
If true then the timestamp must be in the JDBC timestamp escape format, otherwise it must be in the DB2 timestamp format.
isJdbcEscape
)

Implements org.apache.derby.iapi.types.DataValueFactory.getDateValue.

public final NumberDataValue
getDecimalDataValue(Number value, NumberDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getDecimalDataValue.

Get a SQL DECIMAL with the given value.

private LocaleFinder
public BitDataValue
getLongVarbitDataValue(byte[] value, BitDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getLongVarbitDataValue.

Get a SQL Long Bit Varying with the given value.

public StringDataValue
getLongvarcharDataValue(String value)

Implements org.apache.derby.iapi.types.DataValueFactory.getLongvarcharDataValue.

Get a SQL long varchar with the given value.

public StringDataValue
getLongvarcharDataValue(String value, StringDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getLongvarcharDataValue.

Get a SQLLongvarchar object to represent a SQL LONG VARCHAR (UCS_BASIC) with the given value.

public StringDataValue
getLongvarcharDataValue(String value, StringDataValue previous, int collationType)

Implements org.apache.derby.iapi.types.DataValueFactory.getLongvarcharDataValue.

Return a StringDataValue to represent a SQL LONG VARCHAR with the given collation re-using previous if not null.

private static ModuleFactory
getMonitor()

Must be private so that user code can't call this entry point.

public DataValueDescriptor
getNull(int
Format id for the DVD
formatId
,
int
this is meaningful only for character types.
collationType
)

Implements org.apache.derby.iapi.types.DataValueFactory.getNull.

Return an object based on the format id and collation type.

public BitDataValue
getNullBit(BitDataValue dataValue)

Implements org.apache.derby.iapi.types.DataValueFactory.getNullBit.

Get a SQL Bit with a SQL null value.

public BitDataValue
getNullBlob(BitDataValue dataValue)

Implements org.apache.derby.iapi.types.DataValueFactory.getNullBlob.

Get a SQL Blob with a SQL null value.

public BooleanDataValue
getNullBoolean(BooleanDataValue dataValue)

Implements org.apache.derby.iapi.types.DataValueFactory.getNullBoolean.

Get a SQL boolean with a SQL null value.

public NumberDataValue
getNullByte(NumberDataValue dataValue)

Implements org.apache.derby.iapi.types.DataValueFactory.getNullByte.

Get a SQL tinyint with a SQL null value.

public StringDataValue
getNullChar(StringDataValue dataValue)

Implements org.apache.derby.iapi.types.DataValueFactory.getNullChar.

Get a SQL CHAR (UCS_BASIC) with a SQL null value.

public StringDataValue
getNullChar(StringDataValue previous, int collationType)

Implements org.apache.derby.iapi.types.DataValueFactory.getNullChar.

Get a SQL CHAR set to NULL with collation set to collationType.

public StringDataValue
getNullClob(StringDataValue dataValue)

Implements org.apache.derby.iapi.types.DataValueFactory.getNullClob.

Get a SQL CLOB (UCS_BASIC) with a SQL null value.

public StringDataValue
getNullClob(StringDataValue previous, int collationType)

Implements org.apache.derby.iapi.types.DataValueFactory.getNullClob.

Get a SQL CLOB set to NULL with collation set to collationType.

public DateTimeDataValue
getNullDate(DateTimeDataValue dataValue)

Implements org.apache.derby.iapi.types.DataValueFactory.getNullDate.

Get a SQL date with a SQL null value.

public final NumberDataValue
getNullDecimal(NumberDataValue dataValue)

Implements org.apache.derby.iapi.types.DataValueFactory.getNullDecimal.

Get a SQL Decimal/Numeric with a SQL null value.

public NumberDataValue
getNullDouble(NumberDataValue dataValue)

Implements org.apache.derby.iapi.types.DataValueFactory.getNullDouble.

Get a SQL double with a SQL null value.

public static DataValueDescriptor

Returns:

DataValueDescriptor with default collation of UCS_BASIC
getNullDVDWithUCS_BASICcollation
(int
Return a DVD based on the format id
formatId
)

This method will return a DVD based on the formatId.

public NumberDataValue
getNullFloat(NumberDataValue dataValue)

Implements org.apache.derby.iapi.types.DataValueFactory.getNullFloat.

Get a SQL float with a SQL null value.

public NumberDataValue
getNullInteger(NumberDataValue dataValue)

Implements org.apache.derby.iapi.types.DataValueFactory.getNullInteger.

Get a SQL int with a SQL null value.

public NumberDataValue
getNullLong(NumberDataValue dataValue)

Implements org.apache.derby.iapi.types.DataValueFactory.getNullLong.

Get a SQL bigint with a SQL null value.

public BitDataValue
getNullLongVarbit(BitDataValue dataValue)

Implements org.apache.derby.iapi.types.DataValueFactory.getNullLongVarbit.

Get a SQL Long Bit Varying with a SQL null value.

public StringDataValue
getNullLongvarchar(StringDataValue dataValue)

Implements org.apache.derby.iapi.types.DataValueFactory.getNullLongvarchar.

Get a SQL LONG VARCHAR (UCS_BASIC) with a SQL null value.

public StringDataValue
getNullLongvarchar(StringDataValue previous, int collationType)

Implements org.apache.derby.iapi.types.DataValueFactory.getNullLongvarchar.

Get a SQL LONG VARCHAR set to NULL with collation set to collationType.

public UserDataValue
getNullObject(UserDataValue dataValue)

Implements org.apache.derby.iapi.types.DataValueFactory.getNullObject.

Get a User-defined data value with a SQL null value.

public RefDataValue
getNullRef(RefDataValue dataValue)

Implements org.apache.derby.iapi.types.DataValueFactory.getNullRef.

Get a RefDataValue with a SQL null value.

public NumberDataValue
getNullShort(NumberDataValue dataValue)

Implements org.apache.derby.iapi.types.DataValueFactory.getNullShort.

Get a SQL smallint with a SQL null value.

public DateTimeDataValue
getNullTime(DateTimeDataValue dataValue)

Implements org.apache.derby.iapi.types.DataValueFactory.getNullTime.

Get a SQL time with a SQL null value.

public DateTimeDataValue
getNullTimestamp(DateTimeDataValue dataValue)

Implements org.apache.derby.iapi.types.DataValueFactory.getNullTimestamp.

Get a SQL timestamp with a SQL null value.

public BitDataValue
getNullVarbit(BitDataValue dataValue)

Implements org.apache.derby.iapi.types.DataValueFactory.getNullVarbit.

Get a SQL Bit Varying with a SQL null value.

public StringDataValue
getNullVarchar(StringDataValue dataValue)

Implements org.apache.derby.iapi.types.DataValueFactory.getNullVarchar.

Get a SQL VARCHAR (UCS_BASIC) with a SQL null value.

public StringDataValue
getNullVarchar(StringDataValue previous, int collationType)

Implements org.apache.derby.iapi.types.DataValueFactory.getNullVarchar.

Get a SQL VARCHAR set to NULL with collation set to collationType.

public XMLDataValue

Returns:

An XMLDataValue instance corresponding to a NULL value. If an XMLDataValue was received, the returned XMLDataValue is the same instance as the one received, but the actual data has been set to null.
getNullXML
(XMLDataValue
An XMLDataValue instance to re-use.
dataValue
)

Implements org.apache.derby.iapi.types.DataValueFactory.getNullXML.

getNullXML: Get an XML with a SQL null value.

public DateTimeDataValue
getTimestamp(DataValueDescriptor
Must be a timestamp or a string convertible to a timestamp.
operand
)

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

Implement the timestamp SQL function: construct a SQL timestamp from a string, or timestamp.

public DateTimeDataValue
getTimestamp(DataValueDescriptor
Must be convertible to a date.
date
,
DataValueDescriptor
Must be convertible to a time.
time
)

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

Construct a SQL timestamp from a date and time.

public DateTimeDataValue
getTimestampValue(String
A time in string format.
timestampStr
,
boolean
If true then the time must be in the JDBC time escape format, otherwise it must be in the DB2 time format.
isJdbcEscape
)

Implements org.apache.derby.iapi.types.DataValueFactory.getTimestampValue.

public DateTimeDataValue
getTimeValue(String
A date in one of the DB2 standard time formats or the local format.
timeStr
,
boolean
If true then the timestamp must be in the JDBC time escape format, otherwise it must be in the DB2 time format.
isJdbcEscape
)

Implements org.apache.derby.iapi.types.DataValueFactory.getTimeValue.

public BitDataValue
getVarbitDataValue(byte[] value, BitDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getVarbitDataValue.

Get a SQL bit with the given value.

public StringDataValue
getVarcharDataValue(String value)

Implements org.apache.derby.iapi.types.DataValueFactory.getVarcharDataValue.

Get a SQL varchar with the given value.

public StringDataValue
getVarcharDataValue(String value, StringDataValue previous)

Implements org.apache.derby.iapi.types.DataValueFactory.getVarcharDataValue.

Get a SQLVarhar object to represent a SQL VARCHAR (UCS_BASIC) with the given value.

public StringDataValue
getVarcharDataValue(String value, StringDataValue previous, int collationType)

Implements org.apache.derby.iapi.types.DataValueFactory.getVarcharDataValue.

Return a StringDataValue to represent a SQL VARCHAR with the given collation re-using previous if not null.

public XMLDataValue

Returns:

An XMLDataValue instance corresponding to a NULL value. If an XMLDataValue was received, the returned XMLDataValue is the same instance as the one received, but the actual data has been set to a SQL null value.
getXMLDataValue
(XMLDataValue
An XMLDataValue instance to re-use.
previous
)

Implements org.apache.derby.iapi.types.DataValueFactory.getXMLDataValue.

getXMLDataValue: Get a null XML value.

public void
private RuleBasedCollator

Returns:

Collator for database's locale
verifyCollatorSupport
(int
Collator strength or -1 for locale default.
strength
)

Verify that JVM has support for the Collator for the database's locale.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait