Class DataTypeUtilities
java.lang.Object
org.apache.derby.iapi.types.DataTypeUtilities
A set of static utility methods for data types.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TimestampClone a Timestamp because they are mutablestatic intcomputeMaxWidth(int precision, int scale) Compute the maximum width (column display width) of a decimal or numeric data value, given its precision and scale.static intgetColumnDisplaySize(int typeId, int storageLength) static intGets the display width of a column of a given type.static intGet the precision of the datatype, in decimal digits This is used by EmbedResultSetMetaData.static intGet the precision of the datatype.static booleanIs the data type case sensitive.static intIs the data type nullable.static booleanIs the data type signed.
-
Constructor Details
-
DataTypeUtilities
public DataTypeUtilities()
-
-
Method Details
-
clone
-
getPrecision
Get the precision of the datatype.- Parameters:
dtd- data type descriptor
-
getDigitPrecision
Get the precision of the datatype, in decimal digits This is used by EmbedResultSetMetaData.- Parameters:
dtd- data type descriptor
-
isCaseSensitive
Is the data type case sensitive.- Parameters:
dtd- data type descriptor
-
isNullable
Is the data type nullable.- Parameters:
dtd- data type descriptor
-
isSigned
Is the data type signed.- Parameters:
dtd- data type descriptor
-
getColumnDisplaySize
Gets the display width of a column of a given type.- Parameters:
dtd- data type descriptor- Returns:
- associated column display width
-
getColumnDisplaySize
public static int getColumnDisplaySize(int typeId, int storageLength) -
computeMaxWidth
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- The precision (number of digits) of the data value.scale- The number of fractional digits (digits to the right of the decimal point).- Returns:
- The maximum number of chracters needed to display the value.
-