Package org.apache.derby.iapi.types
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 Timestamp
Clone a Timestamp because they are mutablestatic 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.static int
getColumnDisplaySize
(int typeId, int storageLength) static int
Gets the display width of a column of a given type.static int
Get the precision of the datatype, in decimal digits This is used by EmbedResultSetMetaData.static int
Get the precision of the datatype.static boolean
Is the data type case sensitive.static int
Is the data type nullable.static boolean
Is the data type signed.
-
Constructor Details
-
DataTypeUtilities
public DataTypeUtilities()
-
-
Method Details
-
clone
Clone a Timestamp because they are mutable -
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.
-