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

public abstract Class DataTypeUtilities

extends Object
Class Inheritance
Imports
org.apache.derby.shared.common.reference.JDBC40Translation, java.sql.Timestamp, .Types, .ResultSetMetaData

A set of static utility methods for data types.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Timestamp
clone(Timestamp original)

Clone a Timestamp because they are mutable

public static int

Returns:

The maximum number of chracters needed to display the value.
computeMaxWidth
(int
The precision (number of digits) of the data value.
precision
,
int
The number of fractional digits (digits to the right of the decimal point).
scale
)

Compute the maximum width (column display width) of a decimal or numeric data value, given its precision and scale.

public static int

Returns:

associated column display width
getColumnDisplaySize
(DataTypeDescriptor
data type descriptor
dtd
)

Gets the display width of a column of a given type.

public static int
getColumnDisplaySize(int typeId, int storageLength)

public static int
getDigitPrecision(DataTypeDescriptor
data type descriptor
dtd
)

Get the precision of the datatype, in decimal digits This is used by EmbedResultSetMetaData.

public static int
getPrecision(DataTypeDescriptor
data type descriptor
dtd
)

Get the precision of the datatype.

public static boolean
isCaseSensitive(DataTypeDescriptor
data type descriptor
dtd
)

Is the data type case sensitive.

public static int
isNullable(DataTypeDescriptor
data type descriptor
dtd
)

Is the data type nullable.

public static boolean
isSigned(DataTypeDescriptor
data type descriptor
dtd
)

Is the data type signed.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DataTypeUtilitiesback to summary
public DataTypeUtilities()

Method Detail

cloneback to summary
public static Timestamp clone(Timestamp original)

Clone a Timestamp because they are mutable

computeMaxWidthback to summary
public static int computeMaxWidth(int precision, int scale)

Compute the maximum width (column display width) of a decimal or numeric data value, given its precision and scale.

Parameters
precision:int

The precision (number of digits) of the data value.

scale:int

The number of fractional digits (digits to the right of the decimal point).

Returns:int

The maximum number of chracters needed to display the value.

getColumnDisplaySizeback to summary
public static int getColumnDisplaySize(DataTypeDescriptor dtd)

Gets the display width of a column of a given type.

Parameters
dtd:DataTypeDescriptor

data type descriptor

Returns:int

associated column display width

getColumnDisplaySizeback to summary
public static int getColumnDisplaySize(int typeId, int storageLength)
getDigitPrecisionback to summary
public static int getDigitPrecision(DataTypeDescriptor dtd)

Get the precision of the datatype, in decimal digits This is used by EmbedResultSetMetaData.

Parameters
dtd:DataTypeDescriptor

data type descriptor

getPrecisionback to summary
public static int getPrecision(DataTypeDescriptor dtd)

Get the precision of the datatype.

Parameters
dtd:DataTypeDescriptor

data type descriptor

isCaseSensitiveback to summary
public static boolean isCaseSensitive(DataTypeDescriptor dtd)

Is the data type case sensitive.

Parameters
dtd:DataTypeDescriptor

data type descriptor

isNullableback to summary
public static int isNullable(DataTypeDescriptor dtd)

Is the data type nullable.

Parameters
dtd:DataTypeDescriptor

data type descriptor

isSignedback to summary
public static boolean isSigned(DataTypeDescriptor dtd)

Is the data type signed.

Parameters
dtd:DataTypeDescriptor

data type descriptor