A DataTypeDescriptor is immutable.
| Modifier and Type | Field and Description |
|---|---|
| private int | collationDerivation
Derivation of this type. |
| public static final DataTypeDescriptor | DOUBLE
Runtime INTEGER type that is nullable. |
| public static final DataTypeDescriptor | INTEGER
Runtime INTEGER type that is nullable. |
| public static final DataTypeDescriptor | INTEGER_NOT_NULL
Runtime INTEGER type that is not nullable. |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final DataTypeDescriptor | SMALLINT
Runtime SMALLINT type that is nullable. |
| public static final DataTypeDescriptor | SMALLINT_NOT_NULL
Runtime INTEGER type that is not nullable. |
| private TypeDescriptorImpl | |
| private TypeId |
| Access | Constructor and Description |
|---|---|
| public | |
| public | DataTypeDescriptor(TypeId
The typeId of the type being described typeId, int The number of decimal digits. precision, int The number of digits after the decimal point. scale, boolean TRUE means it could contain NULL, FALSE means
it definitely cannot contain NULL. isNullable, int The maximum number of bytes for this datatype maximumWidth)Constructor for use with numeric types |
| public | DataTypeDescriptor(TypeId
The typeId of the type being described typeId, int The number of decimal digits. precision, int The number of digits after the decimal point. scale, boolean TRUE means it could contain NULL, FALSE means
it definitely cannot contain NULL. isNullable, int The maximum number of bytes for this datatype maximumWidth, int The collation type of a string data type collationType, int Collation Derivation of a string data type collationDerivation)Constructor to use when the caller doesn't know if it is requesting numeric or no-numeric DTD. |
| public | DataTypeDescriptor(TypeId
The typeId of the type being described typeId, boolean TRUE means it could contain NULL, FALSE means
it definitely cannot contain NULL. isNullable, int The maximum number of bytes for this datatype maximumWidth)Constructor for use with non-numeric types |
| public | |
| private | |
| private | |
| public | DataTypeDescriptor(DataTypeDescriptor
The DTSI to copy source, int The number of decimal digits. precision, int The number of digits after the decimal point. scale, boolean TRUE means it could contain NULL, FALSE means
it definitely cannot contain NULL. isNullable, int The maximum number of bytes for this datatype maximumWidth)Constructor for internal uses only. |
| public | DataTypeDescriptor(DataTypeDescriptor
The DTSI to copy source, boolean TRUE means it could contain NULL, FALSE means
it definitely cannot contain NULL. isNullable, int The maximum number of bytes for this datatype maximumWidth)Constructor for internal uses only |
| private | DataTypeDescriptor(TypeDescriptorImpl
The TypeDescriptorImpl to construct this DTSI from source, TypeId typeId)Constructor for use in reconstructing a DataTypeDescriptor from a TypeDescriptorImpl and a TypeId |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if compareWithDTD is comparable to this type, else false.the type of the instance to compare with this type. compareWithDTD, boolean True if this is an = or != comparison, false
otherwise. forEquals, ClassFactory A ClassFactory cf)Check if this type is comparable with the passed type. |
| public boolean | Returns: value depends on the algorithm above.compare this DTD's collation info compareWithDTD)Compare the collation info on this DTD with the passed DTD. |
| public boolean | equals(Object
the type to compare to. other)Overrides java. Compare if two DataTypeDescriptors are exactly the same |
| public double | |
| public static DataTypeDescriptor | Returns: A new DataTypeDescriptor that corresponds to the Java type. A null return value means there is no corresponding SQL typeThe int type of the JDBC type for which to get
a corresponding SQL DataTypeDescriptor jdbcType)Get a descriptor that corresponds to a nullable builtin JDBC type. |
| public static DataTypeDescriptor | Returns: A new DataTypeDescriptor that corresponds to the Java type. A null return value means there is no corresponding SQL typeThe int type of the JDBC type for which to get
a corresponding SQL DataTypeDescriptor jdbcType, int length)Get a descriptor that corresponds to a nullable builtin variable length JDBC type. |
| public static DataTypeDescriptor | Returns: A new DataTypeDescriptor that corresponds to the Java type. A null return value means there is no corresponding SQL typeThe int type of the JDBC type for which to get
a corresponding SQL DataTypeDescriptor jdbcType, boolean TRUE means it could contain NULL, FALSE means
it definitely cannot contain NULL. isNullable)Get a descriptor that corresponds to a builtin JDBC type. |
| public static DataTypeDescriptor | Returns: A new DataTypeDescriptor that corresponds to the Java type. A null return value means there is no corresponding SQL typeThe int type of the JDBC type for which to get
a corresponding SQL DataTypeDescriptor jdbcType, boolean TRUE means it could contain NULL, FALSE means
it definitely cannot contain NULL. isNullable, int maxLength)Get a descriptor that corresponds to a builtin JDBC type. |
| public static DataTypeDescriptor | Returns: A new DataTypeDescriptor that corresponds to the Java type. A null return value means there is no corresponding SQL type (only for 'char')The name of the type for which to get
a corresponding SQL DataTypeDescriptor sqlTypeName)Get a DataTypeServices that corresponds to a nullable builtin SQL type. |
| public static DataTypeDescriptor | Returns: A new DataTypeDescriptor that corresponds to the Java type. A null return value means there is no corresponding SQL type (only for 'char')The name of the type for which to get
a corresponding SQL DataTypeDescriptor sqlTypeName, int length)Get a DataTypeServices that corresponds to a builtin SQL type Collation type will be UCS_BASIC and derivation IMPLICIT. |
| public static TypeDescriptor | getCatalogType(int jdbcType, int length)
Return a nullable catalog type for a JDBC builtin type and length. |
| public static TypeDescriptor | |
| public static TypeDescriptor | Returns: catalogType if it already has the correct collation, otherwise a new TypeDescriptor with the correct collation.Type to be based upon. catalogType, int Collation type of returned type. collationType)Get a catlog type identical to the passed in type exception that the collationType is set to the passed in value. |
| public TypeDescriptor | getCatalogType()
Get the simplified type descriptor that is intended to be stored in the system tables. |
| public DataTypeDescriptor | Returns: This if collation would be unchanged otherwise a new type.Return a type description identical to this type with the exception that its collation information is taken from the passed in information. |
| public int | Returns: Should be COLLATION_DERIVATION_NONE or COLLATION_DERIVATION_IMPLICITGet the collation derivation for this type. |
| public String | Returns: the name of the collation being used in this type.Gets the name of the collation type in this descriptor if the collation derivation is not NONE. |
| public static String | Returns: The name, e g "TERRITORY_BASED:PRIMARY".The collation type. collationType)Gets the name of the specified collation type. |
| public int | |
| public static int | Returns: The collation type, or -1 if not recognized.Obtain the collation type from a collation property value. |
| public DataTypeDescriptor | Returns: DataTypeDescriptor DTS for dominant typeDataTypeDescriptor to compare with. otherDTS, ClassFactory A ClassFactory cf)Get the dominant type (DataTypeDescriptor) of the 2. |
| public String | getFullSQLTypeName()
Return the SQL type name and, if applicable, scale/precision/length for this DataTypeDescriptor. |
| public int | |
| public int | |
| public DataValueDescriptor | |
| public DataTypeDescriptor | getNullabilityType(boolean
True to return a nullable type, false otherwise. isNullable)Return a type descriptor identical to the this type with the exception of its nullability. |
| public long[] | |
| public int | Returns: The number of decimal digits for the datatype. Returns zero for non-numeric datatypes.Returns the number of decimal digits for the datatype, if applicable. |
| public static TypeDescriptor | Returns: A new DataTypeDescriptor describing the SQL Row MultisetNames of the columns in the Row Muliset columnNames, TypeDescriptor[] Types of the columns in the Row Muliset catalogTypes)Get a catalog type that corresponds to a SQL Row Multiset |
| private static TypeDescriptor | Returns: this will be returned if no changes are required (e.g. no string types or collation is already correct), otherwise a new instance is returned (leaving this unchanged).For a row multi set type return an identical type with the collation type changed. |
| public int | Returns: The number of digits to the right of the decimal for the datatype. Returns zero for non-numeric datatypes.Returns the number of digits to the right of the decimal for the datatype, if applicable. |
| public static DataTypeDescriptor | Returns: A new DataTypeDescriptor that corresponds to the Java type. A null return value means there is no corresponding SQL type (only for 'char')The name of the Java type for which to get
a corresponding SQL DataTypeDescriptor javaTypeName)Get a DataTypeServices that corresponds to a Java type |
| public static DataTypeDescriptor | Returns: A new DataTypeDescriptor that corresponds to the Java type. A null return value means there is no corresponding SQL type (only for 'char')The name of the Java type for which to get
a corresponding SQL DataTypeDescriptor javaTypeName, boolean TRUE means it could contain NULL, FALSE means
it definitely cannot contain NULL. isNullable)Get a DataTypeServices that corresponds to a Java type |
| public static DataTypeDescriptor | Returns: A new DataTypeDescriptor that corresponds to the Java type. A null return value means there is no corresponding SQL type.The name of the Java type for which to get
a corresponding SQL DataTypeDescriptor javaTypeName, int The number of decimal digits precision, int The number of digits after the decimal point scale, boolean TRUE means it could contain NULL, FALSE means
it definitely cannot contain NULL. isNullable, int The maximum width of a data value
represented by this type. maximumWidth)Get a DataTypeDescriptor that corresponds to a Java type |
| public String | Returns: String version of datatype, suitable for running through the Parser.Converts this data type descriptor (including length/precision) to a string. |
| public String | |
| public static DataTypeDescriptor | |
| public int | Returns: the formatID of this classImplements org. Get the formatID which corresponds to this class. |
| public TypeId | |
| public String | |
| public static boolean | Returns: true if an ASCII stream can be inserted;
false otherwiseJDBC type of column or parameter jdbcType)Determine if an ASCII stream can be inserted into a column or parameter
of type |
| public static boolean | Returns: true if a binary stream can be inserted;
false otherwiseJDBC type of column or parameter jdbcType)Determine if a binary stream can be inserted into a column or parameter
of type |
| private static boolean | Returns: true iff jdbcType is compatible with
byte[]a JDBC type jdbcType)Check whether a JDBC type is compatible with the Java type
|
| public static boolean | Returns: true if a character stream can be inserted;
false otherwiseJDBC type of column or parameter jdbcType)Determine if a character stream can be inserted into a column or
parameter of type |
| private static boolean | Returns: true iff jdbcType is a character type
and compatible with Stringa JDBC type jdbcType)Check whether a JDBC type is one of the character types that are
compatible with the Java type |
| public boolean | Returns: boolean Whether or not the 2 DTSs have the same type and length.DataTypeDescriptor to compare with. otherDTS)Check whether or not the 2 types (DataTypeDescriptor) have the same type and length. |
| public static boolean | Returns: boolean true if types are equivalent, false if notJDBC type id of Derby data type existingType, int JDBC type id passed in from application. jdbcTypeId)Compare JdbcTypeIds to determine if they represent equivalent SQL types. |
| public boolean | Returns: TRUE if the datatype can contain NULL, FALSE if not.Returns TRUE if the datatype can contain NULL, FALSE if not. |
| public static boolean | |
| public boolean | Returns: True if the type associated with this DTD can be created via the CREATE TABLE syntax; false otherwise.Check to make sure that this type id is something a user can create him/herself directly through an SQL CREATE TABLE statement. |
| public DataValueDescriptor | |
| public void | readExternal(ObjectInput
read this. in)Implements java. Read this object from a stream of stored objects. |
| public String | |
| public void | writeExternal(ObjectOutput
write bytes here. out)Implements java. Write this object to a stream of stored objects. |
| collationDerivation | back to summary |
|---|---|
| private int collationDerivation Derivation of this type. All catalog types are by definition implicit. | |
| DOUBLE | back to summary |
|---|---|
| public static final DataTypeDescriptor DOUBLE Runtime INTEGER type that is nullable. | |
| INTEGER | back to summary |
|---|---|
| public static final DataTypeDescriptor INTEGER Runtime INTEGER type that is nullable. | |
| INTEGER_NOT_NULL | back to summary |
|---|---|
| public static final DataTypeDescriptor INTEGER_NOT_NULL Runtime INTEGER type that is not nullable. | |
| MAX_MIN_ARRAY_SIZE | back to summary |
|---|---|
| public static final int MAX_MIN_ARRAY_SIZE | |
| MAX_VALUE_IDX | back to summary |
|---|---|
| public static final int MAX_VALUE_IDX | |
| MIN_VALUE_IDX | back to summary |
|---|---|
| public static final int MIN_VALUE_IDX | |
| SMALLINT | back to summary |
|---|---|
| public static final DataTypeDescriptor SMALLINT Runtime SMALLINT type that is nullable. | |
| SMALLINT_NOT_NULL | back to summary |
|---|---|
| public static final DataTypeDescriptor SMALLINT_NOT_NULL Runtime INTEGER type that is not nullable. | |
| typeDescriptor | back to summary |
|---|---|
| private TypeDescriptorImpl typeDescriptor | |
| typeId | back to summary |
|---|---|
| private TypeId typeId | |
| DataTypeDescriptor | back to summary |
|---|---|
| public DataTypeDescriptor() Public niladic constructor. Needed for Formatable interface to work. | |
| DataTypeDescriptor | back to summary |
|---|---|
| public DataTypeDescriptor(TypeId typeId, int precision, int scale, boolean isNullable, int maximumWidth) Constructor for use with numeric types
| |
| DataTypeDescriptor | back to summary |
|---|---|
| public DataTypeDescriptor(TypeId typeId, int precision, int scale, boolean isNullable, int maximumWidth, int collationType, int collationDerivation) Constructor to use when the caller doesn't know if it is requesting numeric or no-numeric DTD. For instance, when dealing with MAX/MIN aggregrate operators, AggregateNode.bindExpression could be dealing with a character string operand or a numeric operand. The result of MAX/MIN will depend on the type of it's operand. And hence when this constructor gets called by AggregateNode.bindExpression, we don't know what type we are constructing and hence this constructor supports arguments for both numeric and non-numeric types.
| |
| DataTypeDescriptor | back to summary |
|---|---|
| public DataTypeDescriptor(TypeId typeId, boolean isNullable, int maximumWidth) Constructor for use with non-numeric types
| |
| DataTypeDescriptor | back to summary |
|---|---|
| public DataTypeDescriptor(TypeId typeId, boolean isNullable) | |
| DataTypeDescriptor | back to summary |
|---|---|
| private DataTypeDescriptor(DataTypeDescriptor source, boolean isNullable) | |
| DataTypeDescriptor | back to summary |
|---|---|
| private DataTypeDescriptor(DataTypeDescriptor source, int collationType, int collationDerivation) | |
| DataTypeDescriptor | back to summary |
|---|---|
| public DataTypeDescriptor(DataTypeDescriptor source, int precision, int scale, boolean isNullable, int maximumWidth) Constructor for internal uses only. (This is useful when the precision and scale are potentially wider than those in the source, like when determining the dominant data type.)
| |
| DataTypeDescriptor | back to summary |
|---|---|
| public DataTypeDescriptor(DataTypeDescriptor source, boolean isNullable, int maximumWidth) Constructor for internal uses only
| |
| DataTypeDescriptor | back to summary |
|---|---|
| private DataTypeDescriptor(TypeDescriptorImpl source, TypeId typeId) Constructor for use in reconstructing a DataTypeDescriptor from a TypeDescriptorImpl and a TypeId
| |
| comparable | back to summary |
|---|---|
| public boolean comparable(DataTypeDescriptor compareWithDTD, boolean forEquals, ClassFactory cf) Check if this type is comparable with the passed type.
| |
| compareCollationInfo | back to summary |
|---|---|
| public boolean compareCollationInfo(DataTypeDescriptor compareWithDTD) Compare the collation info on this DTD with the passed DTD. The rules for comparison are as follows (these are as per SQL standard 2003 Section 9.13) 1)If both the DTDs have collation derivation of NONE, then they can't be compared and we return false. 2)If both the DTDs have same collation derivation (which in Derby's case at this point will mean collation derivation of IMPLICIT), then check the collation types. If they match, then return true. If they do not match, then they can't be compared and hence return false. 3)If one DTD has collation derivation of IMPLICIT and other DTD has collation derivation of NONE, then 2 DTDs are comparable using the collation type of DTD with collation derivation of IMPLICIT. Derby does not implement this rule currently and it is being traked as DERBY-2678. Derby's current behavior is to throw an exception if both the DTDs involved in collation operation do not have collation derivation of IMPLICIT. This behavior is a subset of SQL standard. 4)Derby currently does not support collation derivation of EXPLICIT and hence we do not have the code to enforce rules as mentioned in Section 9.13 of SQL spec for collation derivation of EXPLICIT. When we implement collation derivation of EXPLICIT, we should make sure that we follow the rules as specified in the SQL spec for comparability.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Compare if two DataTypeDescriptors are exactly the same
| |
| estimatedMemoryUsage | back to summary |
|---|---|
| public double estimatedMemoryUsage() Get the estimated memory usage for this type descriptor. | |
| getBuiltInDataTypeDescriptor | back to summary |
|---|---|
| public static DataTypeDescriptor getBuiltInDataTypeDescriptor(int jdbcType) Get a descriptor that corresponds to a nullable builtin JDBC type. If a variable length type then the size information will be set to the maximum possible. Collation type will be UCS_BASIC and derivation IMPLICIT. For well known types code may also use the pre-defined runtime types that are fields of this class, such as INTEGER.
| |
| getBuiltInDataTypeDescriptor | back to summary |
|---|---|
| public static DataTypeDescriptor getBuiltInDataTypeDescriptor(int jdbcType, int length) Get a descriptor that corresponds to a nullable builtin variable length JDBC type. Collation type will be UCS_BASIC and derivation IMPLICIT.
| |
| getBuiltInDataTypeDescriptor | back to summary |
|---|---|
| public static DataTypeDescriptor getBuiltInDataTypeDescriptor(int jdbcType, boolean isNullable) Get a descriptor that corresponds to a builtin JDBC type. For well known types code may also use the pre-defined runtime types that are fields of this class, such as INTEGER. E.g. using DataTypeDescriptor.INTEGER is preferred to DataTypeDescriptor.getBuiltInDataTypeDescriptor(Types.INTEGER, true) (both will return the same immutable object).
| |
| getBuiltInDataTypeDescriptor | back to summary |
|---|---|
| public static DataTypeDescriptor getBuiltInDataTypeDescriptor(int jdbcType, boolean isNullable, int maxLength) Get a descriptor that corresponds to a builtin JDBC type. Collation type will be UCS_BASIC and derivation IMPLICIT.
| |
| getBuiltInDataTypeDescriptor | back to summary |
|---|---|
| public static DataTypeDescriptor getBuiltInDataTypeDescriptor(String sqlTypeName) Get a DataTypeServices that corresponds to a nullable builtin SQL type. Collation type will be UCS_BASIC and derivation IMPLICIT.
| |
| getBuiltInDataTypeDescriptor | back to summary |
|---|---|
| public static DataTypeDescriptor getBuiltInDataTypeDescriptor(String sqlTypeName, int length) Get a DataTypeServices that corresponds to a builtin SQL type Collation type will be UCS_BASIC and derivation IMPLICIT.
| |
| getCatalogType | back to summary |
|---|---|
| public static TypeDescriptor getCatalogType(int jdbcType, int length) Return a nullable catalog type for a JDBC builtin type and length. | |
| getCatalogType | back to summary |
|---|---|
| public static TypeDescriptor getCatalogType(int jdbcType) Return a nullable catalog type for a fixed length JDBC builtin type. | |
| getCatalogType | back to summary |
|---|---|
| public static TypeDescriptor getCatalogType(TypeDescriptor catalogType, int collationType) Get a catlog type identical to the passed in type exception that the collationType is set to the passed in value.
| |
| getCatalogType | back to summary |
|---|---|
| public TypeDescriptor getCatalogType() Get the simplified type descriptor that is intended to be stored in the system tables. | |
| getCollatedType | back to summary |
|---|---|
| public DataTypeDescriptor getCollatedType(int collationType, int collationDerivation) Return a type description identical to this type with the exception that its collation information is taken from the passed in information. If the type does not represent a string type then the collation will be unchanged and this is returned.
| |
| getCollationDerivation | back to summary |
|---|---|
| public int getCollationDerivation() Get the collation derivation for this type. This applies only for character string types. For the other types, this api should be ignored. SQL spec talks about character string types having collation type and collation derivation associated with them (SQL spec Section 4.2.2 Comparison of character strings). If collation derivation says explicit or implicit, then it means that there is a valid collation type associated with the charcter string type. If the collation derivation is none, then it means that collation type can't be established for the character string type. 1)Collation derivation will be explicit if SQL COLLATE clause has been used for character string type (this is not a possibility for Derby 10.3 because we are not planning to support SQL COLLATE clause in the 10.3 release). 2)Collation derivation will be implicit if the collation can be determined w/o the COLLATE clause eg CREATE TABLE t1(c11 char(4)) then c11 will have collation of USER character set. Another eg, TRIM(c11) then the result character string of TRIM operation will have collation of the operand, c11. 3)Collation derivation will be none if the aggregate methods are dealing with character strings with different collations (Section 9.3 Data types of results of aggregations Syntax Rule 3aii). Collation derivation will be initialized to COLLATION_DERIVATION_IMPLICIT if not explicitly set.
| |
| getCollationName | back to summary |
|---|---|
| public String getCollationName() Gets the name of the collation type in this descriptor if the collation derivation is not NONE. If the collation derivation is NONE, then this method will return "NONE". This method is used for generating error messages which will use correct string describing collation type/derivation.
| |
| getCollationName | back to summary |
|---|---|
| public static String getCollationName(int collationType) Gets the name of the specified collation type.
| |
| getCollationType | back to summary |
|---|---|
| public int getCollationType() Obtain the collation type of the underlying catalog type. Shorthand method for getCatalogType().getCollationType().
| |
| getCollationType | back to summary |
|---|---|
| public static int getCollationType(String collationName) Obtain the collation type from a collation property value.
| |
| getDominantType | back to summary |
|---|---|
| public DataTypeDescriptor getDominantType(DataTypeDescriptor otherDTS, ClassFactory cf) Get the dominant type (DataTypeDescriptor) of the 2. For variable length types, the resulting type will have the biggest max length of the 2. If either side is nullable, then the result will also be nullable. If dealing with character string types, then make sure to set the collation info on the dominant type. Following algorithm will be used for dominant DTD's collation determination. Each of the steps of the algorithm have been numbered in the comments below and those same numbers are used in the actual algorithm below so it is easier to understand and maintain. Step 1 If the DTD for "this" node has the same collation derivation as the otherDTS, then check if their collation types match too. If the collation types match too, then DTD for dominant type will get the same collation derivation and type. Step 2 If the collation derivation for DTD for "this" node and otherDTS do not match, then check if one of them has the collation derivation of NONE. If that is the case, then dominant DTD will get the collation type and derivation of DTD whose collation derivation is not NONE. Step 3 If the collation derivation for DTD for "this" node and otherDTS do not match, and none of them have the derivation of NONE then it means that we are dealing with collation derivation of IMPLICIT and EXPLICIT and hence the dominant DTD should get collation derivation of NONE. This is not a possibility in Derby 10.3 because the only 2 possible collation derivation supported are IMPLICIT and NONE. Step 4 If the collation derivation for DTD for "this" node and otherDTS match, then check if the collation types match too. If not, then the dominant DTD should get collation derivation of NONE.
| |
| getFullSQLTypeName | back to summary |
|---|---|
| public String getFullSQLTypeName() Return the SQL type name and, if applicable, scale/precision/length for this DataTypeDescriptor. Note that we want the values from *this* object specifically, not the max values defined on this.typeId. | |
| getJDBCTypeId | back to summary |
|---|---|
| public int getJDBCTypeId() Get the jdbc type id for this type. JDBC type can be found in java.sql.Types. Shorthand method for getCatalogType().getJDBCTypeId().
| |
| getMaximumWidth | back to summary |
|---|---|
| public int getMaximumWidth() Shorthand method for getCatalogType().getMaximumWidth().
| |
| getNull | back to summary |
|---|---|
| public DataValueDescriptor getNull() throws StandardException Get a Null for this type. | |
| getNullabilityType | back to summary |
|---|---|
| public DataTypeDescriptor getNullabilityType(boolean isNullable) Return a type descriptor identical to the this type with the exception of its nullability. If the nullablity required matches the nullability of this then this is returned.
| |
| getNumericBounds | back to summary |
|---|---|
| public long[] getNumericBounds() throws StandardException Get the maximum and minimum value for a fixed numeric type. Throws an unimplemented feature exception for a non-numeric type. | |
| getPrecision | back to summary |
|---|---|
| public int getPrecision() Returns the number of decimal digits for the datatype, if applicable. Shorthand method for getCatalogType().getPrecision().
| |
| getRowMultiSet | back to summary |
|---|---|
| public static TypeDescriptor getRowMultiSet(String[] columnNames, TypeDescriptor[] catalogTypes) Get a catalog type that corresponds to a SQL Row Multiset
| |
| getRowMultiSetCollation | back to summary |
|---|---|
| private static TypeDescriptor getRowMultiSetCollation(TypeDescriptor catalogType, int collationType) For a row multi set type return an identical type
with the collation type changed. Note that since
row types are only ever catalog types the
derivation is not used (since derivation is a property
of runtime types).
| |
| getScale | back to summary |
|---|---|
| public int getScale() Returns the number of digits to the right of the decimal for the datatype, if applicable. Shorthand method for getCatalogType().getScale().
| |
| getSQLDataTypeDescriptor | back to summary |
|---|---|
| public static DataTypeDescriptor getSQLDataTypeDescriptor(String javaTypeName) throws StandardException Get a DataTypeServices that corresponds to a Java type
| |
| getSQLDataTypeDescriptor | back to summary |
|---|---|
| public static DataTypeDescriptor getSQLDataTypeDescriptor(String javaTypeName, boolean isNullable) throws StandardException Get a DataTypeServices that corresponds to a Java type
| |
| getSQLDataTypeDescriptor | back to summary |
|---|---|
| public static DataTypeDescriptor getSQLDataTypeDescriptor(String javaTypeName, int precision, int scale, boolean isNullable, int maximumWidth) throws StandardException Get a DataTypeDescriptor that corresponds to a Java type
| |
| getSQLstring | back to summary |
|---|---|
| public String getSQLstring() Converts this data type descriptor (including length/precision) to a string. E.g. VARCHAR(30) or java.util.Hashtable
| |
| getSQLTypeNameWithCollation | back to summary |
|---|---|
| public String getSQLTypeNameWithCollation() | |
| getType | back to summary |
|---|---|
| public static DataTypeDescriptor getType(TypeDescriptor catalogType) Return a runtime type for a catalog type. | |
| getTypeFormatId | back to summary |
|---|---|
| public int getTypeFormatId() Implements org. Get the formatID which corresponds to this class.
| |
| getTypeId | back to summary |
|---|---|
| public TypeId getTypeId() Gets the TypeId for the datatype.
| |
| getTypeName | back to summary |
|---|---|
| public String getTypeName() Gets the name of this datatype.
| |
| isAsciiStreamAssignable | back to summary |
|---|---|
| public static boolean isAsciiStreamAssignable(int jdbcType) Determine if an ASCII stream can be inserted into a column or parameter
of type
| |
| isBinaryStreamAssignable | back to summary |
|---|---|
| public static boolean isBinaryStreamAssignable(int jdbcType) Determine if a binary stream can be inserted into a column or parameter
of type
| |
| isBinaryType | back to summary |
|---|---|
| private static boolean isBinaryType(int jdbcType) Check whether a JDBC type is compatible with the Java type
Note
| |
| isCharacterStreamAssignable | back to summary |
|---|---|
| public static boolean isCharacterStreamAssignable(int jdbcType) Determine if a character stream can be inserted into a column or
parameter of type
| |
| isCharacterType | back to summary |
|---|---|
| private static boolean isCharacterType(int jdbcType) Check whether a JDBC type is one of the character types that are
compatible with the Java type Note
There are some non-character types that are compatible with
| |
| isExactTypeAndLengthMatch | back to summary |
|---|---|
| public boolean isExactTypeAndLengthMatch(DataTypeDescriptor otherDTS) Check whether or not the 2 types (DataTypeDescriptor) have the same type and length. This is useful for UNION when trying to decide whether a NormalizeResultSet is required.
| |
| isJDBCTypeEquivalent | back to summary |
|---|---|
| public static boolean isJDBCTypeEquivalent(int existingType, int jdbcTypeId) Compare JdbcTypeIds to determine if they represent equivalent SQL types. For example Types.NUMERIC and Types.DECIMAL are equivalent
| |
| isNullable | back to summary |
|---|---|
| public boolean isNullable() Returns TRUE if the datatype can contain NULL, FALSE if not. JDBC supports a return value meaning "nullability unknown" - I assume we will never have columns where the nullability is unknown. Shorthand method for getCatalogType().isNullable();
| |
| isNumericType | back to summary |
|---|---|
| public static boolean isNumericType(int jdbcType) | |
| isUserCreatableType | back to summary |
|---|---|
| public boolean isUserCreatableType() throws StandardException Check to make sure that this type id is something a user can create him/herself directly through an SQL CREATE TABLE statement. This method is used for CREATE TABLE AS ... WITH [NO] DATA binding because it's possible for the query to return types which are not actually creatable for a user. DERBY-2605. Three examples are: JAVA_OBJECT: A user can select columns of various java object types from system tables, but s/he is not allowed to create such a column him/herself. DECIMAL: A user can specify a VALUES clause with a constant that has a precision of greater than 31. Derby can apparently handle such a value internally, but the user is not supposed to be able create such a column him/herself.
| |
| normalize | back to summary |
|---|---|
| public DataValueDescriptor normalize(DataValueDescriptor source, DataValueDescriptor cachedDest) throws StandardException | |
| readExternal | back to summary |
|---|---|
| public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException Implements java. Read this object from a stream of stored objects.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| writeExternal | back to summary |
|---|---|
| public void writeExternal(ObjectOutput out) throws IOException Implements java. Write this object to a stream of stored objects.
| |