Oracle10g JDBC

oracle.sql
Class StructDescriptor

java.lang.Object
  extended byoracle.sql.TypeDescriptor
      extended byoracle.sql.StructDescriptor
All Implemented Interfaces:
java.io.Serializable

public class StructDescriptor
extends TypeDescriptor
implements java.io.Serializable

Descriptor of a SQL structured object. (That is an SQL Object type). Its main responsibility is understanding how to convert between various representations of such a struct.

There should be a method to return information about the fields (beyond their number. But there is no public representation for that.

See Also:
Serialized Form

Field Summary
static java.lang.String BUILD_DATE
           
static boolean PRIVATE_TRACE
           
static boolean TRACE
           
 
Fields inherited from class oracle.sql.TypeDescriptor
DEBUG_SERIALIZATION
 
Method Summary
static StructDescriptor createDescriptor(java.lang.String name, java.sql.Connection conn)
          Descriptor factory.
 java.lang.String descType()
          Describe this type.
 java.lang.String getJavaClassName()
          Returns the external name of the JAVA_STRUCT type.
 java.lang.String getLanguage()
           
 int getLength()
          The number of fields in the Object Type.
 int getLocalAttributeCount()
          Returns the number of attributes defined in the subtype.
 java.sql.ResultSetMetaData getMetaData()
          Gets the metadata regarding this type.
 java.lang.String[] getSubtypeNames()
          Returns the SQL type names of the direct subtypes.
 java.lang.String getSupertypeName()
          Returns the SQL type name of the direct subtype.
 int getTypeCode()
           
 int getTypeVersion()
           
 boolean isFinalType()
          Indicates whether the object type is a final type.
 boolean isInstantiable()
          Indicates whether the object type is instantiable.
 boolean isJavaObject()
          Indicates whether the object type is a JAVA_STRUCT type or a STRUCT type.
 boolean isSubtype()
          Indicates whether the object type is a subtype.
 Datum[] toOracleArray(java.util.Map attributes)
           
 
Methods inherited from class oracle.sql.TypeDescriptor
getName, getSubtypeName, setConnection
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRACE

public static final boolean TRACE
See Also:
Constant Field Values

PRIVATE_TRACE

public static final boolean PRIVATE_TRACE
See Also:
Constant Field Values

BUILD_DATE

public static final java.lang.String BUILD_DATE
See Also:
Constant Field Values
Method Detail

createDescriptor

public static StructDescriptor createDescriptor(java.lang.String name,
                                                java.sql.Connection conn)
                                         throws java.sql.SQLException
Descriptor factory. Lookup the name in the database, and determine the characteristics of this array.

Parameters:
name - a String naming the type. (Not necessarily fully qualified)
Throws:
java.sql.SQLException

getTypeCode

public int getTypeCode()
                throws java.sql.SQLException
Throws:
java.sql.SQLException

getTypeVersion

public int getTypeVersion()
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

getLength

public int getLength()
              throws java.sql.SQLException
The number of fields in the Object Type.

Returns:
the size.
Throws:
java.sql.SQLException

toOracleArray

public Datum[] toOracleArray(java.util.Map attributes)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

getMetaData

public java.sql.ResultSetMetaData getMetaData()
                                       throws java.sql.SQLException
Gets the metadata regarding this type. The return ResultSetMetaData contains the attribute name, attribute type id and attribute type precision information. The column index in ResultSetMetaData maps to the position of the attribute in a Struct (with the first attribute being at index 1).

Returns:
a ResultSetMetaData object that contains the type info
Throws:
if - database access error occurs
java.sql.SQLException

isFinalType

public boolean isFinalType()
                    throws java.sql.SQLException
Indicates whether the object type is a final type.

Returns:
true if the object type is a final type and false otherwise.
Throws:
java.sql.SQLException
Since:
8.2.0

isSubtype

public boolean isSubtype()
                  throws java.sql.SQLException
Indicates whether the object type is a subtype.

Returns:
true if the object type is a subtype and false otherwise.
Throws:
java.sql.SQLException
Since:
8.2.0

isInstantiable

public boolean isInstantiable()
                       throws java.sql.SQLException
Indicates whether the object type is instantiable.

Returns:
true if the object type is instantiable and false otherwise.
Throws:
java.sql.SQLException
Since:
8.2.0

isJavaObject

public boolean isJavaObject()
                     throws java.sql.SQLException
Indicates whether the object type is a JAVA_STRUCT type or a STRUCT type.

Returns:
true if the object type is a JAVA_STRUCT type and false if the object type is a STRUCT type.
Throws:
java.sql.SQLException
Since:
8.2.0

getSupertypeName

public java.lang.String getSupertypeName()
                                  throws java.sql.SQLException
Returns the SQL type name of the direct subtype.

Returns:
the fully qualified name of the supertype. Returns null if the object type is not a subtype.
Throws:
java.sql.SQLException
Since:
8.2.0

getLocalAttributeCount

public int getLocalAttributeCount()
                           throws java.sql.SQLException
Returns the number of attributes defined in the subtype.

Returns:
number of subtype attributes.
Throws:
java.sql.SQLException
Since:
8.2.0

getSubtypeNames

public java.lang.String[] getSubtypeNames()
                                   throws java.sql.SQLException
Returns the SQL type names of the direct subtypes.

Returns:
the fully qualifed name of the direct subtypes. Returns an empty String array if there is no subtypes.
Throws:
java.sql.SQLException
Since:
8.2.0

getJavaClassName

public java.lang.String getJavaClassName()
                                  throws java.sql.SQLException
Returns the external name of the JAVA_STRUCT type.

Returns:
the JAVA_STRUCT's Java type name. Returns null if the object type is not a JAVA_STRUCT type.
Throws:
java.sql.SQLException
Since:
8.2.0

getLanguage

public java.lang.String getLanguage()
                             throws java.sql.SQLException
Returns:
JAVA if this is a JAVA_STRUCT, SQL otherwise
Throws:
java.sql.SQLException
Since:
8.2.0

descType

public java.lang.String descType()
                          throws java.sql.SQLException
Describe this type.

Returns:
the type information.
Throws:
java.sql.SQLException

Oracle10g JDBC

Copyright © 1998,2004, Oracle. All rights reserved