Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.6.0)

E13403-07

Package oracle.javatools.db.datatypes

Classes related to datatypes in the database API.

See:
          Description

Interface Summary
DataType Interface defines a database datatype (e.g.
 

Class Summary
BaseDateTimeDataType  
BinaryDataType  
CharacterDataType  
ComplexType Implementation of DataType for ComplexTypes.
DataTypeAttribute  
DataTypeHelper Helper class for unwrapping the DataTypeUsage object.
DataTypeID INTERNAL USE ONLY.
DataTypeRegistry Registry for DataTypes.
DataTypeRegistry.Registerer A Registerer is responsible for providing allowed DataTypes for a given provider class.
DataTypeSynonym DataType implementation that delegates all calls to an underlying DataType that it is a "synonym" for.
DataTypeUsage To "use" a DataType is to refere to it by ID and store values for any attributes that DataType may have (e.g.
DateDataType  
NumericDataType  
NumericDataType.MinMaxValue public static class MinMaxValue defines the minimum and maximum value range of integer and floating-point numbers for use by NumericDataType.validateDefaultValue().
ObjectType Deprecated.
ObjectTypeUsage  
PredefinedDataType  
PredefinedDataTypeUsage  
TimeStampTZDataType  
UserDataType Defines a data type that we 'discovered' when importing or navigating a database, usually from a foreign database, or for un-imported object types.
 

Enum Summary
ComplexType.SQLJUsingType  
 

Exception Summary
DataTypeValidationException  
DefaultValueValidationException  
 

Package oracle.javatools.db.datatypes Description

Classes related to datatypes in the database API. DataType definitions are DBObjects, and are retrieved from a DBObjectProvider using the listDataTypes and getDataType methods. For ComplexType objects the listObjects and getObject methods should be used with their type string ComplexType.TYPE.

Related Documentation

When a datatype is used, for example in a column, the information about it is encapsulated in a DataTypeUsage object. This includes the ID of the datatype, as well as any attributes associated with its use (e.g. size, scale, precision etc). For more information see DataTypeUsage. In general when using DataType and DataTypeUsage objects, the DataTypeHelper class provides a lot of useful helper methods.

Examples

A Column's DataTypeUsage

Getting the size for a varchar2 column:
  final Column ename = table.getColumn( "ENAME" );
  final DataTypeUsage datatypeUsage = ename.getDataTypeUsage();
  final Long size = DataTypeHelper.getLongAttributeValue(
                                         datatypeUsage,
                                         DataTypeAttribute.DATATYPE_SIZE );

Creating a DataTypeUsage

Creating a VARCHAR2 column of size 30:
  final DataType datatype = provider.getDataType( "VARCHAR2" );
  final DataTypeUsage datatypeUsage = datatype.createDefaultUsage();
  datatypeUsage.putAttributeValue( DataTypeAttribute.DATATYPE_SIZE,
                                   30L );

See Also:
oracle.javatools.db

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.6.0)

E13403-07

Copyright © 1997, 2011, Oracle. All rights reserved.