Interface ORAData

public abstract interface ORAData

Oracle interface for customized user-defined types.

This is an interface for encapsulating SQL types into Java types of the user's choice. User's class, which implements the ORAData interface, can present a customized version of the SQL type.

One can have lots of different classes implementing CustomDatum for a particular SQL type but generally each type implementing ORAData will be used for only a single SQL type.

For use as a SQL type, a class that implements ORAData must contain the following static fields and methods:

public static ORADataFactory getFactory() { ... }

public static final int _SQL_TYPECODE = oracle.jdbc.OracleTypes....;

// for STRUCT and ARRAY
public static final String _SQL_NAME = "...";

// for REF and ARRAY
public static final String _SQL_BASETYPE = "...";

This interface is the replacement of the old CustomDatum interface that has been deprecated in the Oracle 9i release.

See Also:
oracle.jdbc.ORADataFactory, oracle.jdbc.PreparedStatement, java.sql.SQLData

Method Summary
 Datum toDatum(java.sql.Connection c)
          Extract an oracle.sql.Datum object.

Method Detail


public Datum toDatum(java.sql.Connection c)
              throws java.sql.SQLException
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.

c - The connection into which the value is being sent.
a Datum contaning the value to be sent into the connection.
java.sql.SQLException - if an error occurred.