Skip navigation links

Oracle Database JDBC Java API Reference
11g Release 2

E13995-03


oracle.sql
Class TypeDescriptor

java.lang.Object
  extended by oracle.sql.TypeDescriptor

All Implemented Interfaces:
java.io.Serializable, oracle.jdbc.internal.ObjectData, OracleData, OracleTypeMetaData, ORAData
Direct Known Subclasses:
ArrayDescriptor, OpaqueDescriptor, StructDescriptor

public class TypeDescriptor
extends java.lang.Object
implements OracleTypeMetaData, java.io.Serializable, ORAData, OracleData

The descriptor of pre-defined types.

See Also:
Serialized Form

Nested Class Summary

 

Nested classes/interfaces inherited from interface oracle.jdbc.OracleTypeMetaData
OracleTypeMetaData.Array, OracleTypeMetaData.ArrayStorage, OracleTypeMetaData.Kind, OracleTypeMetaData.Opaque, OracleTypeMetaData.Struct

 

Field Summary
static byte[] ANYDATASETTOID
           
static byte[] ANYDATATOID
           
static byte[] ANYTYPETOID
           
static boolean DEBUG_SERIALIZATION
           
static byte[] RAWTOID
           
static boolean TRACE
           
static short TYPECODE_BDOUBLE
           
static short TYPECODE_BFILE
           
static short TYPECODE_BFLOAT
           
static short TYPECODE_BLOB
           
static short TYPECODE_BOOLEAN
           
static short TYPECODE_CFILE
           
static short TYPECODE_CHAR
           
static short TYPECODE_CLOB
           
static short TYPECODE_DATE
           
static short TYPECODE_DECIMAL
           
static short TYPECODE_DOUBLE
           
static short TYPECODE_ERRHP
           
static short TYPECODE_FLOAT
           
static short TYPECODE_INTEGER
           
static short TYPECODE_INTERVAL_DS
           
static short TYPECODE_INTERVAL_YM
           
static short TYPECODE_ITABLE
           
static short TYPECODE_JDBC_ARRAY
           
static short TYPECODE_JDBC_JOBJECT
           
static short TYPECODE_JDBC_JOPAQUE
           
static short TYPECODE_JDBC_JSTRUCT
           
static short TYPECODE_JDBC_REF
           
static short TYPECODE_JDBC_STRUCT
           
static short TYPECODE_MLSLABEL
           
static short TYPECODE_NAMEDCOLLECTION
           
static short TYPECODE_NCHAR
           
static short TYPECODE_NCLOB
           
static short TYPECODE_NONE
           
static short TYPECODE_NUMBER
           
static short TYPECODE_NVARCHAR2
           
static short TYPECODE_OBJECT
           
static short TYPECODE_OCTET
           
static short TYPECODE_OPAQUE
           
static short TYPECODE_OTMFIRST
           
static short TYPECODE_OTMLAST
           
static short TYPECODE_PLS_INTEGER
           
static short TYPECODE_PTR
           
static short TYPECODE_RAW
           
static short TYPECODE_REAL
           
static short TYPECODE_RECORD
           
static short TYPECODE_REF
           
static short TYPECODE_SIGNED16
           
static short TYPECODE_SIGNED32
           
static short TYPECODE_SIGNED8
           
static short TYPECODE_SMALLINT
           
static short TYPECODE_SYSFIRST
           
static short TYPECODE_SYSLAST
           
static short TYPECODE_TABLE
           
static short TYPECODE_TIME
           
static short TYPECODE_TIME_TZ
           
static short TYPECODE_TIMESTAMP
           
static short TYPECODE_TIMESTAMP_LTZ
           
static short TYPECODE_TIMESTAMP_TZ
           
static short TYPECODE_UNSIGNED16
           
static short TYPECODE_UNSIGNED32
           
static short TYPECODE_UNSIGNED8
           
static short TYPECODE_UROWID
           
static short TYPECODE_VARCHAR
           
static short TYPECODE_VARCHAR2
           
static short TYPECODE_VARRAY
           
static byte[] XMLTYPETOID
           

 

Method Summary
 short getInternalTypeCode()
           
 OracleTypeMetaData.Kind getKind()
          Return the kind of type.
 java.lang.String getName()
          Return fully qualified type name.
 long getPrecision()
           
 byte getScale()
           
static java.lang.String getSubtypeName(OracleConnection conn, byte[] image, long offset)
           
 int getTypeCode()
          Returns type code.
 java.lang.String getTypeCodeName()
          Returns the type code name.
 void initMetadataRecursively()
           
 void initNamesRecursively()
           
 boolean isTransient()
           
 void printXML(java.io.PrintStream s)
          Print an XML representation of this type and all OracleTypes within.
 void printXML(java.io.PrintStream stream, boolean fetchAllMetaDataAsNeeded)
          Print an XML representation of this type and all OracleTypes within.
 void setConnection(java.sql.Connection connection)
           
 void setPrecision(long _precision)
           
 void setScale(byte _scale)
           
 Datum toDatum(java.sql.Connection c)
          Extract an oracle.sql.Datum object.
 java.lang.Object toJDBCObject(java.sql.Connection c)
          Extract a jdbc Object.
 java.lang.String toXMLString()
          Creates a String which is an XML representation of this type and all OracleTypes within.
 java.lang.String toXMLString(boolean fetchAllMetaDataAsNeeded)
          Creates a String which is an XML representation of this type and all OracleTypes within.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

DEBUG_SERIALIZATION

public static boolean DEBUG_SERIALIZATION

RAWTOID

public static final byte[] RAWTOID

ANYTYPETOID

public static final byte[] ANYTYPETOID

ANYDATATOID

public static final byte[] ANYDATATOID

ANYDATASETTOID

public static final byte[] ANYDATASETTOID

XMLTYPETOID

public static final byte[] XMLTYPETOID

TYPECODE_REF

public static final short TYPECODE_REF
See Also:
Constant Field Values

TYPECODE_DATE

public static final short TYPECODE_DATE
See Also:
Constant Field Values

TYPECODE_SIGNED8

public static final short TYPECODE_SIGNED8
See Also:
Constant Field Values

TYPECODE_SIGNED16

public static final short TYPECODE_SIGNED16
See Also:
Constant Field Values

TYPECODE_SIGNED32

public static final short TYPECODE_SIGNED32
See Also:
Constant Field Values

TYPECODE_REAL

public static final short TYPECODE_REAL
See Also:
Constant Field Values

TYPECODE_DOUBLE

public static final short TYPECODE_DOUBLE
See Also:
Constant Field Values

TYPECODE_BFLOAT

public static final short TYPECODE_BFLOAT
See Also:
Constant Field Values

TYPECODE_BDOUBLE

public static final short TYPECODE_BDOUBLE
See Also:
Constant Field Values

TYPECODE_FLOAT

public static final short TYPECODE_FLOAT
See Also:
Constant Field Values

TYPECODE_NUMBER

public static final short TYPECODE_NUMBER
See Also:
Constant Field Values

TYPECODE_DECIMAL

public static final short TYPECODE_DECIMAL
See Also:
Constant Field Values

TYPECODE_UNSIGNED8

public static final short TYPECODE_UNSIGNED8
See Also:
Constant Field Values

TYPECODE_UNSIGNED16

public static final short TYPECODE_UNSIGNED16
See Also:
Constant Field Values

TYPECODE_UNSIGNED32

public static final short TYPECODE_UNSIGNED32
See Also:
Constant Field Values

TYPECODE_OCTET

public static final short TYPECODE_OCTET
See Also:
Constant Field Values

TYPECODE_SMALLINT

public static final short TYPECODE_SMALLINT
See Also:
Constant Field Values

TYPECODE_INTEGER

public static final short TYPECODE_INTEGER
See Also:
Constant Field Values

TYPECODE_RAW

public static final short TYPECODE_RAW
See Also:
Constant Field Values

TYPECODE_PTR

public static final short TYPECODE_PTR
See Also:
Constant Field Values

TYPECODE_VARCHAR2

public static final short TYPECODE_VARCHAR2
See Also:
Constant Field Values

TYPECODE_CHAR

public static final short TYPECODE_CHAR
See Also:
Constant Field Values

TYPECODE_VARCHAR

public static final short TYPECODE_VARCHAR
See Also:
Constant Field Values

TYPECODE_MLSLABEL

public static final short TYPECODE_MLSLABEL
See Also:
Constant Field Values

TYPECODE_VARRAY

public static final short TYPECODE_VARRAY
See Also:
Constant Field Values

TYPECODE_TABLE

public static final short TYPECODE_TABLE
See Also:
Constant Field Values

TYPECODE_OBJECT

public static final short TYPECODE_OBJECT
See Also:
Constant Field Values

TYPECODE_OPAQUE

public static final short TYPECODE_OPAQUE
See Also:
Constant Field Values

TYPECODE_NAMEDCOLLECTION

public static final short TYPECODE_NAMEDCOLLECTION
See Also:
Constant Field Values

TYPECODE_BLOB

public static final short TYPECODE_BLOB
See Also:
Constant Field Values

TYPECODE_BFILE

public static final short TYPECODE_BFILE
See Also:
Constant Field Values

TYPECODE_CLOB

public static final short TYPECODE_CLOB
See Also:
Constant Field Values

TYPECODE_CFILE

public static final short TYPECODE_CFILE
See Also:
Constant Field Values

TYPECODE_TIME

public static final short TYPECODE_TIME
See Also:
Constant Field Values

TYPECODE_TIME_TZ

public static final short TYPECODE_TIME_TZ
See Also:
Constant Field Values

TYPECODE_TIMESTAMP

public static final short TYPECODE_TIMESTAMP
See Also:
Constant Field Values

TYPECODE_TIMESTAMP_TZ

public static final short TYPECODE_TIMESTAMP_TZ
See Also:
Constant Field Values

TYPECODE_TIMESTAMP_LTZ

public static final short TYPECODE_TIMESTAMP_LTZ
See Also:
Constant Field Values

TYPECODE_INTERVAL_YM

public static final short TYPECODE_INTERVAL_YM
See Also:
Constant Field Values

TYPECODE_INTERVAL_DS

public static final short TYPECODE_INTERVAL_DS
See Also:
Constant Field Values

TYPECODE_UROWID

public static final short TYPECODE_UROWID
See Also:
Constant Field Values

TYPECODE_OTMFIRST

public static final short TYPECODE_OTMFIRST
See Also:
Constant Field Values

TYPECODE_OTMLAST

public static final short TYPECODE_OTMLAST
See Also:
Constant Field Values

TYPECODE_SYSFIRST

public static final short TYPECODE_SYSFIRST
See Also:
Constant Field Values

TYPECODE_SYSLAST

public static final short TYPECODE_SYSLAST
See Also:
Constant Field Values

TYPECODE_PLS_INTEGER

public static final short TYPECODE_PLS_INTEGER
See Also:
Constant Field Values

TYPECODE_ITABLE

public static final short TYPECODE_ITABLE
See Also:
Constant Field Values

TYPECODE_RECORD

public static final short TYPECODE_RECORD
See Also:
Constant Field Values

TYPECODE_BOOLEAN

public static final short TYPECODE_BOOLEAN
See Also:
Constant Field Values

TYPECODE_NCHAR

public static final short TYPECODE_NCHAR
See Also:
Constant Field Values

TYPECODE_NVARCHAR2

public static final short TYPECODE_NVARCHAR2
See Also:
Constant Field Values

TYPECODE_NCLOB

public static final short TYPECODE_NCLOB
See Also:
Constant Field Values

TYPECODE_NONE

public static final short TYPECODE_NONE
See Also:
Constant Field Values

TYPECODE_ERRHP

public static final short TYPECODE_ERRHP
See Also:
Constant Field Values

TYPECODE_JDBC_JOBJECT

public static final short TYPECODE_JDBC_JOBJECT
See Also:
Constant Field Values

TYPECODE_JDBC_STRUCT

public static final short TYPECODE_JDBC_STRUCT
See Also:
Constant Field Values

TYPECODE_JDBC_ARRAY

public static final short TYPECODE_JDBC_ARRAY
See Also:
Constant Field Values

TYPECODE_JDBC_JOPAQUE

public static final short TYPECODE_JDBC_JOPAQUE
See Also:
Constant Field Values

TYPECODE_JDBC_REF

public static final short TYPECODE_JDBC_REF
See Also:
Constant Field Values

TYPECODE_JDBC_JSTRUCT

public static final short TYPECODE_JDBC_JSTRUCT
See Also:
Constant Field Values

TRACE

public static final boolean TRACE
See Also:
Constant Field Values

Method Detail

getKind

public OracleTypeMetaData.Kind getKind()
Description copied from interface: OracleTypeMetaData
Return the kind of type.
Specified by:
getKind in interface OracleTypeMetaData
Returns:
the kind, TYPE

getName

public java.lang.String getName()
                         throws java.sql.SQLException
Return fully qualified type name.
Specified by:
getName in interface OracleTypeMetaData
Throws:
java.sql.SQLException

getTypeCode

public int getTypeCode()
                throws java.sql.SQLException
Returns type code.
Specified by:
getTypeCode in interface OracleTypeMetaData
Throws:
java.sql.SQLException

getTypeCodeName

public java.lang.String getTypeCodeName()
                                 throws java.sql.SQLException
Returns the type code name.
Specified by:
getTypeCodeName in interface OracleTypeMetaData
Throws:
java.sql.SQLException

getInternalTypeCode

public short getInternalTypeCode()
                          throws java.sql.SQLException
Throws:
java.sql.SQLException

toDatum

public Datum toDatum(java.sql.Connection c)
              throws java.sql.SQLException
Description copied from interface: ORAData
Extract an oracle.sql.Datum object.

This method is invoked by setORAData() to extract a Datum. The implementation of this method must return the correct type of Datum.

Although most implementation will ignore the connection, it is occassionally needed. For example, if the class embeds CHAR attributes, connection may be needed to determine the database character set.

Specified by:
toDatum in interface ORAData
Parameters:
c - The connection into which the value is being sent.
Returns:
a Datum contaning the value to be sent into the connection.
Throws:
java.sql.SQLException - if an error occurred.

toJDBCObject

public java.lang.Object toJDBCObject(java.sql.Connection c)
                              throws java.sql.SQLException
Description copied from interface: OracleData
Extract a jdbc Object.

This method is invoked by setObject() to extract the jdbc Object. The implementation must return the jdbc Object that correctly represents the underlying SQLType.

Although most implementation will ignore the connection, it is ocassionally needed. for example, if the class embeds CHAR attributes, connection may be needed to determine the database character set.

Specified by:
toJDBCObject in interface OracleData
Parameters:
c - The connection into which the value is being sent.
Returns:
a jdbc Object contianing the value to be sent into the connection.
Throws:
java.sql.SQLException - if an error occurred.

isTransient

public boolean isTransient()

setPrecision

public void setPrecision(long _precision)

getPrecision

public long getPrecision()

setScale

public void setScale(byte _scale)

getScale

public byte getScale()

setConnection

public void setConnection(java.sql.Connection connection)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

getSubtypeName

public static java.lang.String getSubtypeName(OracleConnection conn,
                                              byte[] image,
                                              long offset)
                                       throws java.sql.SQLException
Throws:
java.sql.SQLException

initMetadataRecursively

public void initMetadataRecursively()
                             throws java.sql.SQLException
Throws:
java.sql.SQLException

initNamesRecursively

public void initNamesRecursively()
                          throws java.sql.SQLException
Throws:
java.sql.SQLException

toXMLString

public java.lang.String toXMLString()
                             throws java.sql.SQLException
Creates a String which is an XML representation of this type and all OracleTypes within. Metadata for object types and collections is relatively expensive to get from the server. Not all of it is necessary depending on how the TypeDescriptor is used. In normal operation it is fetched as needed. This method will provide a representation of this type in its current state without fetching additional data
Throws:
java.sql.SQLException

toXMLString

public java.lang.String toXMLString(boolean fetchAllMetaDataAsNeeded)
                             throws java.sql.SQLException
Creates a String which is an XML representation of this type and all OracleTypes within. Optionally causes any metadata which has not been previously fetched from the server to be obtained so as to provide a complete representation. See toXMLString()
Parameters:
fetchAllMetaDataAsNeeded - if set to true and if necessary the driver will fetch the metadata from the server
Throws:
java.sql.SQLException

printXML

public void printXML(java.io.PrintStream s)
              throws java.sql.SQLException
Print an XML representation of this type and all OracleTypes within.
Parameters:
s - a PrintStream upon which to write
Throws:
java.sql.SQLException

printXML

public void printXML(java.io.PrintStream stream,
                     boolean fetchAllMetaDataAsNeeded)
              throws java.sql.SQLException
Print an XML representation of this type and all OracleTypes within.
Parameters:
stream - a PrintStream upon which to write
fetchAllMetaDataAsNeeded - if set to true and if necessary the driver will fetch the metadata from the server
Throws:
java.sql.SQLException

Skip navigation links

Oracle Database JDBC Java API Reference
11g Release 2

E13995-03


Copyright © 2009, Oracle and/or its affiliates. All rights reserved.