Package oracle.sql
Class TypeDescriptor
- java.lang.Object
-
- oracle.sql.TypeDescriptor
-
- All Implemented Interfaces:
Serializable
,oracle.jdbc.internal.ACProxyable
,oracle.jdbc.internal.ObjectData
,oracle.jdbc.internal.OracleTypeMetaData
,OracleData
,OracleTypeMetaData
,ORAData
- Direct Known Subclasses:
ArrayDescriptor
,OpaqueDescriptor
,StructDescriptor
public class TypeDescriptor extends Object implements oracle.jdbc.internal.OracleTypeMetaData, Serializable, ORAData, OracleData
The descriptor of pre-defined types.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface oracle.jdbc.internal.OracleTypeMetaData
oracle.jdbc.internal.OracleTypeMetaData.Array, oracle.jdbc.internal.OracleTypeMetaData.Opaque, oracle.jdbc.internal.OracleTypeMetaData.Struct
-
Nested classes/interfaces inherited from interface oracle.jdbc.OracleTypeMetaData
OracleTypeMetaData.ArrayStorage, OracleTypeMetaData.Kind
-
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protected
TypeDescriptor(short _typeCode)
protected
TypeDescriptor(short _typeCode, String name, Connection conn)
protected
TypeDescriptor(short _typeCode, oracle.jdbc.oracore.OracleTypeADT type, Connection conn)
protected
TypeDescriptor(short _typeCode, oracle.sql.SQLName name, Connection conn)
protected
TypeDescriptor(short _typeCode, oracle.sql.SQLName name, oracle.jdbc.oracore.OracleTypeADT type, Connection conn)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
convToUpperCase(String str)
Convert the String to UpperCase character by characterprotected oracle.jdbc.internal.OracleConnection
getConnectionDuringExceptionHandling()
short
getInternalTypeCode()
OracleTypeMetaData.Kind
getKind()
Return the kind of type.String
getName()
Return fully qualified type name.long
getPrecision()
byte
getScale()
static String
getSubtypeName(OracleConnection conn, byte[] image, long offset)
int
getTypeCode()
Returns type code.String
getTypeCodeName()
Returns the type code name.void
initMetadataRecursively()
void
initNamesRecursively()
boolean
isTransient()
static boolean
isV2available(byte[] toid)
void
printXML(PrintStream s)
Print an XML representation of this type and all OracleTypes within.void
printXML(PrintStream stream, boolean fetchAllMetaDataAsNeeded)
Print an XML representation of this type and all OracleTypes within.void
setConnection(Connection connection)
void
setPrecision(long _precision)
void
setScale(byte _scale)
Datum
toDatum(Connection c)
Extract an oracle.sql.Datum object.Object
toJDBCObject(Connection c)
Extract a jdbc Object.String
toXMLString()
Creates a String which is an XML representation of this type and all OracleTypes within.String
toXMLString(boolean fetchAllMetaDataAsNeeded)
Creates a String which is an XML representation of this type and all OracleTypes within.
-
-
-
Field Detail
-
DEBUG_SERIALIZATION
public static boolean DEBUG_SERIALIZATION
-
KOIDFLEN
public static final int KOIDFLEN
- See Also:
- Constant Field Values
-
RAWTOID
public static final byte[] RAWTOID
-
JSONTOID
public static final byte[] JSONTOID
-
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
-
TYPECODE_SQLXML
public static final short TYPECODE_SQLXML
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TypeDescriptor
protected TypeDescriptor(short _typeCode)
-
TypeDescriptor
protected TypeDescriptor(short _typeCode, String name, Connection conn) throws SQLException
- Throws:
SQLException
-
TypeDescriptor
protected TypeDescriptor(short _typeCode, oracle.sql.SQLName name, Connection conn) throws SQLException
- Throws:
SQLException
-
TypeDescriptor
protected TypeDescriptor(short _typeCode, oracle.sql.SQLName name, oracle.jdbc.oracore.OracleTypeADT type, Connection conn) throws SQLException
- Throws:
SQLException
-
TypeDescriptor
protected TypeDescriptor(short _typeCode, oracle.jdbc.oracore.OracleTypeADT type, Connection conn) throws SQLException
- Throws:
SQLException
-
-
Method Detail
-
getKind
public OracleTypeMetaData.Kind getKind()
Description copied from interface:OracleTypeMetaData
Return the kind of type.- Specified by:
getKind
in interfaceOracleTypeMetaData
- Returns:
- the kind, TYPE
-
getName
public String getName() throws SQLException
Return fully qualified type name.- Specified by:
getName
in interfaceOracleTypeMetaData
- Throws:
SQLException
-
getTypeCode
public int getTypeCode() throws SQLException
Returns type code.- Specified by:
getTypeCode
in interfaceOracleTypeMetaData
- Throws:
SQLException
-
getTypeCodeName
public String getTypeCodeName() throws SQLException
Returns the type code name.- Specified by:
getTypeCodeName
in interfaceOracleTypeMetaData
- Throws:
SQLException
-
getInternalTypeCode
public short getInternalTypeCode() throws SQLException
- Throws:
SQLException
-
isV2available
public static boolean isV2available(byte[] toid)
-
toDatum
public Datum toDatum(Connection c) throws 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 interfaceORAData
- Parameters:
c
- The connection into which the value is being sent.- Returns:
- a Datum contaning the value to be sent into the connection.
- Throws:
SQLException
- if an error occurred.
-
toJDBCObject
public Object toJDBCObject(Connection c) throws 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 interfaceOracleData
- 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:
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(Connection connection) throws SQLException
- Throws:
SQLException
-
getSubtypeName
public static String getSubtypeName(OracleConnection conn, byte[] image, long offset) throws SQLException
- Throws:
SQLException
-
initMetadataRecursively
public void initMetadataRecursively() throws SQLException
- Throws:
SQLException
-
initNamesRecursively
public void initNamesRecursively() throws SQLException
- Throws:
SQLException
-
toXMLString
public String toXMLString() throws 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:
SQLException
-
toXMLString
public String toXMLString(boolean fetchAllMetaDataAsNeeded) throws 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:
SQLException
-
printXML
public void printXML(PrintStream s) throws SQLException
Print an XML representation of this type and all OracleTypes within.- Parameters:
s
- a PrintStream upon which to write- Throws:
SQLException
-
printXML
public void printXML(PrintStream stream, boolean fetchAllMetaDataAsNeeded) throws SQLException
Print an XML representation of this type and all OracleTypes within.- Parameters:
stream
- a PrintStream upon which to writefetchAllMetaDataAsNeeded
- if set to true and if necessary the driver will fetch the metadata from the server- Throws:
SQLException
-
getConnectionDuringExceptionHandling
protected oracle.jdbc.internal.OracleConnection getConnectionDuringExceptionHandling()
-
-