Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Instead of using custom classes that implement the standard SQLData interface, we can use custom classes that implement the Oracle proprietary interfaces ORAData and ORADataFactory. The ORAData interface provides more flexibility as compared to the SQLData interface. For example, it lets you provide a mapping between Java object types and any SQL type supported by the oracle.sql package. Later, we will examine a detailed comparison between using the standard SQLData interface and using the ORAData and ORADataFactory interfaces.
Let’s start off with the definitions of ORAData and ORADataFactory:
public interface ORAData
{
Datum toDatum (OracleConnection connection) throws SQLException;
}
public interface ORADataFactory
{
ORAData create (Datum datum, int sqlTypeCode) throws SQLException;
}