oracle.jdbc.internal.ObjectData
ANYDATA
, ArrayDescriptor
, OpaqueDescriptor
, StructDescriptor
, TypeDescriptor
public interface ORAData
extends oracle.jdbc.internal.ObjectData
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="O___"; // 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.
oracle.jdbc.ORADataFactory
, oracle.jdbc.PreparedStatement
, SQLData
Modifier and Type | Method | Description |
---|---|---|
Datum |
toDatum(Connection c) |
Extract an oracle.sql.Datum object.
|
Datum toDatum(Connection c) throws SQLException
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.SQLException
- if an error occurred.