Class Hierarchy Previous Next Index
Interface COM.cloudscape.types.TypeDescriptor
- public interface TypeDescriptor
- extends java.io.Externalizable
Copyright © 1998-2000, Informix Software, Inc. All rights reserved.
An interface for describing types in Cloudscape systems.
The values in system catalog DATATYPE columns are of type
TypeDescriptor.
BUILTIN- Denotes a built-in type.
MAXIMUM_WIDTH_UNKNOWN- The return value from getMaximumWidth() for types where the maximum
width is unknown.
SERIALIZABLE- Denotes a serialized user type.
getJDBCTypeId()
- Get the jdbc type id for this type.
getMaximumWidth()
- Returns the maximum width of the type.
getPrecision()
- Returns the number of decimal digits for the type, if applicable.
getScale()
- Returns the number of digits to the right of the decimal for
the type, if applicable.
getSQLstring()
- Converts this type descriptor (including length/precision)
to a string suitable for appearing in a SQL type specifier.
getStorageType()
- Returns the storage type for this type.
getTypeName()
- Gets the name of this type.
isNullable()
- Gets the nullability that values of this type have.
MAXIMUM_WIDTH_UNKNOWN
public static final int MAXIMUM_WIDTH_UNKNOWN
The return value from getMaximumWidth() for types where the maximum
width is unknown.
BUILTIN
public static final int BUILTIN
Denotes a built-in type.
SERIALIZABLE
public static final int SERIALIZABLE
Denotes a serialized user type.
getJDBCTypeId
public int getJDBCTypeId()
Get the jdbc type id for this type. JDBC type can be
found in java.sql.Types.
- Returns:
- a jdbc type, e.g. java.sql.Types.DECIMAL
- See Also:
- java.sql.Types
getMaximumWidth
public int getMaximumWidth()
Returns the maximum width of the type. This may have
different meanings for different types. For example, with char,
it means the maximum number of characters, while with int, it
is the number of bytes (i.e. 4).
- Returns:
- the maximum length of this Type; -1 means "unknown/no max length"
getPrecision
public int getPrecision()
Returns the number of decimal digits for the type, if applicable.
- Returns:
- The number of decimal digits for the type. Returns
zero for non-numeric types.
getScale
public int getScale()
Returns the number of digits to the right of the decimal for
the type, if applicable.
- Returns:
- The number of digits to the right of the decimal for
the type. Returns zero for non-numeric types.
isNullable
public boolean isNullable()
Gets the nullability that values of this type have.
- Returns:
- true if values of this type may be null. false otherwise
getTypeName
public java.lang.String getTypeName()
Gets the name of this type.
- Returns:
- the name of this type
getSQLstring
public java.lang.String getSQLstring()
Converts this type descriptor (including length/precision)
to a string suitable for appearing in a SQL type specifier. E.g.
VARCHAR(30)
or
serialize ( java.util.Hashtable )
- Returns:
- String version of type, suitable for running through
a SQL Parser.
getStorageType
public int getStorageType()
Returns the storage type for this type. Currently supported
storage types are BUILTIN and SERIALIZABLE.
- Returns:
- storage type of this type
Class Hierarchy Previous Next Index