Package oracle.sql

Class TypeDescriptor

java.lang.Object
oracle.sql.TypeDescriptor
All Implemented Interfaces:
Serializable, oracle.jdbc.diagnostics.Diagnosable, oracle.jdbc.diagnostics.PropertyChangeListener, 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, oracle.jdbc.diagnostics.Diagnosable
The descriptor of pre-defined types.
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • 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 String getName() throws SQLException
      Return fully qualified type name.
      Specified by:
      getName in interface OracleTypeMetaData
      Throws:
      SQLException
    • getTypeCode

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

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

      public short getInternalTypeCode() throws SQLException
      Throws:
      SQLException
    • isV2available

      public static boolean isV2available(byte[] toid)
    • getTypeDescriptor

      public static TypeDescriptor getTypeDescriptor(String qualifiedName, OracleConnection conn, byte[] image, long offset) throws SQLException
      Obtain the type descriptor associated with the specified type name.
      Parameters:
      name - specifies the type name.
      conn - specifies the associated connection.
      Returns:
      the appropriate descriptor for Array or Struct depending on the type name.
      Throws:
      SQLException - if the specified type does not exist, or if an error occurred.
    • 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 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:
      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 occassionally 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 containing 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 write
      fetchAllMetaDataAsNeeded - 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()
    • convToUpperCase

      public static String convToUpperCase(String str)
      Convert the String to UpperCase character by character
      Parameters:
      String -
      Returns:
      String converted to Uppercase
    • getDiagnosable

      public oracle.jdbc.diagnostics.Diagnosable getDiagnosable()
      Specified by:
      getDiagnosable in interface oracle.jdbc.diagnostics.Diagnosable