|Oracle8i JDBC Developer's Guide and Reference
Release 3 (8.1.7)
Part Number A83724-01
Oracle object types provide support for composite data structures in the database. For example, you can define a type
Person that has attributes such as name (type
CHAR), phone number (type
CHAR), and employee number (type
Oracle provides tight integration between its Oracle object features and its JDBC functionality. You can use a standard, generic JDBC type to map to Oracle objects, or you can customize the mapping by creating custom Java type definition classes. In this book, Java classes that you create to map to Oracle objects will be referred to as custom Java classes or, more specifically, custom object classes. This is as opposed to custom references classes to map to object references, and custom collection classes to map to Oracle collections. Custom object classes can implement either a standard JDBC interface or an Oracle extension interface to read and write data.
JDBC materializes Oracle objects as instances of particular Java classes. Two main steps in using JDBC to access Oracle objects are: 1) creating the Java classes for the Oracle objects, and 2) populating these classes. You have two options:
STRUCT. This is described in "Using the Default STRUCT Class for Oracle Objects".
java.sql.SQLDatainterface or the Oracle extension
oracle.sql.CustomDatuminterface. This is described in "Creating and Using Custom Object Classes for Oracle Objects".
You can use the Oracle JPublisher utility to generate custom Java classes.
When you use the