Package oracle.jdbc

Interface OracleData

  • All Known Implementing Classes:
    ANYDATA, ArrayDescriptor, OpaqueDescriptor, StructDescriptor, TypeDescriptor

    public interface OracleData
    Oracle interface for customize user-defined types.

    This is a new interface for encapsualting SQL types into Java types of the user's choice replacing ORAData. Users should use OracleData instead of ORAData. A User's class, which implements the OracleData interface, can present a customized version of the SQL type. A class XXXClass implementing OracleData must also implement the following method :

      public static XXXClass valueOf( YYYType value) throws SQLException 
      

    where YYYtype can be one of the specific Java Object types in column 2 of Table B-3 of the JDBC spec.

    This interface is the replacement of the ORAData interface

    Since:
    11.2.0.3
    See Also:
    OracleDataFactory
    • Method Detail

      • toJDBCObject

        Object toJDBCObject​(Connection conn)
                     throws SQLException
        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.

        Parameters:
        conn - 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.