Package oracle.sql

Class REF

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.sql.Ref, oracle.jdbc.internal.ACProxyable, oracle.jdbc.internal.OracleConcreteProxy, oracle.jdbc.internal.OracleDatumWithConnection, oracle.jdbc.internal.OracleRef, OracleRef

    public class REF
    extends DatumWithConnection
    implements oracle.jdbc.internal.OracleRef, java.io.Serializable, java.lang.Cloneable, oracle.jdbc.internal.OracleConcreteProxy
    Deprecated.
    Use java.sql.Ref interface for declaration instead of using concrete class oracle.sql.REF.
    The REF class is a representation of the Oracle REF datatype, and it implements the java.sql.Ref interface. Use Ref interface for declaration instead of using concrete class oracle.sql.REF. java.sql.Ref has methods declared for all opertions. For Oracle specific methods use the interface OracleRef.

    Obtaining java.sql.Ref from ResultSet

    java.sql.Ref ref = resultSet.getRef(...);

    There is no way to create Ref on the client side.

    See Also:
    Ref, OracleRef, Serialized Form
    • Field Detail

      • target

        protected oracle.jdbc.driver.OracleRef target
        Deprecated.
    • Method Detail

      • getTarget

        public oracle.jdbc.driver.OracleRef getTarget()
        Deprecated.
      • getBaseTypeName

        public java.lang.String getBaseTypeName()
                                         throws java.sql.SQLException
        Deprecated.
        Implements the Ref interface method. Gets the fully-qualified SQL structured type name of the referenced item.
        Specified by:
        getBaseTypeName in interface java.sql.Ref
        Returns:
        fully-qualified SQL structured type name of the referenced item.
        Throws:
        java.sql.SQLException - if a database access error occurs
      • getValue

        public java.lang.Object getValue​(java.util.Map map)
                                  throws java.sql.SQLException
        Deprecated.
        Oracle extension. Get referenced object. Use "map" for customized type mapping.
        Specified by:
        getValue in interface oracle.jdbc.internal.OracleRef
        Parameters:
        map - contains mapping of SQL type names to Java classes
        Returns:
        the referenced object which can be a STRUCT or any java object defined in type map.
        Throws:
        java.sql.SQLException
      • getValue

        public java.lang.Object getValue()
                                  throws java.sql.SQLException
        Deprecated.
        Oracle extension. Get referenced object. Use the connection type map for customized type mapping.
        Specified by:
        getValue in interface oracle.jdbc.internal.OracleRef
        Returns:
        the referenced object which can be a STRUCT or any java object defined in type map.
        Throws:
        java.sql.SQLException
      • getSTRUCT

        public STRUCT getSTRUCT()
                         throws java.sql.SQLException
        Deprecated.
        Oracle extension. Get the referenced object as a STRUCT instance. Customized type mapping is ignored.
        Specified by:
        getSTRUCT in interface oracle.jdbc.internal.OracleRef
        Throws:
        java.sql.SQLException
      • setValue

        public void setValue​(java.lang.Object value)
                      throws java.sql.SQLException
        Deprecated.
        Oracle extension. Set REF value. The method updated the underly object value in database.
        Specified by:
        setValue in interface oracle.jdbc.internal.OracleRef
        Parameters:
        value - the value to be set.
        Throws:
        java.sql.SQLException
      • getOracleMetaData

        public OracleTypeMetaData getOracleMetaData()
                                             throws java.sql.SQLException
        Deprecated.
        Return the type data for this object
        Specified by:
        getOracleMetaData in interface OracleRef
        Returns:
        type metadata
        Throws:
        java.sql.SQLException - if an error occurs
        Since:
        11.2.0.3.0
      • getDescriptor

        public StructDescriptor getDescriptor()
                                       throws java.sql.SQLException
        Deprecated.
        Oracle extension. Return the type descriptor of the ADT type that this REF object points to.
        Specified by:
        getDescriptor in interface oracle.jdbc.internal.OracleRef
        Throws:
        java.sql.SQLException
      • getSQLTypeName

        public java.lang.String getSQLTypeName()
                                        throws java.sql.SQLException
        Deprecated.
        Oracle extension. Return the type name of the ADT type that this REF object points to.
        Specified by:
        getSQLTypeName in interface oracle.jdbc.internal.OracleRef
        Throws:
        java.sql.SQLException
      • getObject

        public java.lang.Object getObject​(java.util.Map map)
                                   throws java.sql.SQLException
        Deprecated.
        Specified by:
        getObject in interface java.sql.Ref
        Throws:
        java.sql.SQLException
      • getObject

        public java.lang.Object getObject()
                                   throws java.sql.SQLException
        Deprecated.
        JDBC 3.0 Retrieves the SQL structured type instance referenced by this Ref object. If the connection's type map has an entry for the structured type, the instance will be custom mapped to the Java class indicated in the type map. Otherwise, the structured type instance will be mapped to a Struct object.
        Specified by:
        getObject in interface java.sql.Ref
        Returns:
        a Java Object that is the mapping for the SQL structured type to which this Ref object refers
        Throws:
        java.sql.SQLException - if a database access error occurs
        Since:
        9.0.2
        See Also:
        setObject(java.lang.Object)
      • setObject

        public void setObject​(java.lang.Object value)
                       throws java.sql.SQLException
        Deprecated.
        JDBC 3.0 Sets the structured type value that this Ref object references to the given instance of Object. The driver converts this to an SQL structured type when it sends it to the database.
        Specified by:
        setObject in interface java.sql.Ref
        Parameters:
        value - an Object representing the SQL structured type instance that this Ref object will reference
        Throws:
        java.sql.SQLException - if a database access error occurs
        Since:
        10R1
        See Also:
        getObject(), getObject(Map), PreparedStatement.setObject(int, Object), PreparedStatement#setObject(String, Object)
      • toJdbc

        public java.lang.Object toJdbc()
                                throws java.sql.SQLException
        Deprecated.
        Convert this data object into its default Java object type.
        Specified by:
        toJdbc in interface oracle.jdbc.internal.OracleDatumWithConnection
        Specified by:
        toJdbc in interface oracle.jdbc.internal.OracleRef
        Specified by:
        toJdbc in class Datum
        Returns:
        this object.
        Throws:
        java.sql.SQLException - if any of the lower layer code throws an exception.
      • toJdbc

        public java.lang.Object toJdbc​(java.util.Map map)
                                throws java.sql.SQLException
        Deprecated.
        Convert this data object into the Java object as defined in map if the data object type is not mapped to any class then its converted into default Java object type
        Parameters:
        map - connection type map
        Returns:
        jdbcObject
        Throws:
        java.sql.SQLException
      • toClass

        public java.lang.Object toClass​(java.lang.Class clazz,
                                        java.util.Map map)
                                 throws java.sql.SQLException
        Deprecated.
        Returns the required object based on the class to which the SQL structured type is mapped to.
        Throws:
        java.sql.SQLException
      • isConvertibleTo

        public boolean isConvertibleTo​(java.lang.Class<?> jClass)
        Deprecated.
        Test whether this data object can be converted to the specified Java data type.
        Specified by:
        isConvertibleTo in interface oracle.jdbc.internal.OracleDatumWithConnection
        Specified by:
        isConvertibleTo in interface oracle.jdbc.internal.OracleRef
        Specified by:
        isConvertibleTo in class Datum
        Parameters:
        jClass - specifies the Java data type to test against.
        Returns:
        true if this data object is convertible to the specified Java class, and a corresponding xxxValue() method is available; otherwise, a false is returned.
      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Deprecated.
        Specified by:
        clone in interface oracle.jdbc.internal.OracleRef
        Overrides:
        clone in class java.lang.Object
        Throws:
        java.lang.CloneNotSupportedException
      • equals

        public boolean equals​(java.lang.Object obj)
        Deprecated.
        Description copied from class: Datum
        Test any object for equality with an Datum. Datums are equal if they are of the same class and their bytes are the same.
        Specified by:
        equals in interface oracle.jdbc.internal.OracleRef
        Overrides:
        equals in class Datum
        Parameters:
        obj - object to compare this with
        Returns:
        true if the class of this is the same as the class of obj and the byte representation of this is the same as the byte representation of obj.
      • hashCode

        public int hashCode()
        Deprecated.
        Specified by:
        hashCode in interface oracle.jdbc.internal.OracleRef
        Overrides:
        hashCode in class java.lang.Object
      • getJavaSqlConnection

        public java.sql.Connection getJavaSqlConnection()
                                                 throws java.sql.SQLException
        Deprecated.
        Description copied from class: DatumWithConnection
        Oracle extension Return the java.sql.Connection associated with the receiver. Since 9.0.0 not all Oracle JDBC connection objects are assignment compatible with oracle.jdbc.driver.OracleConnection. If the connection is wrapped, return the outermost wrapper.
        Specified by:
        getJavaSqlConnection in interface oracle.jdbc.internal.OracleDatumWithConnection
        Overrides:
        getJavaSqlConnection in class DatumWithConnection
        Returns:
        the connection
        Throws:
        java.sql.SQLException - if an error occurs