Oracle8i SQLJ Developer's Guide and Reference
Release 8.1.5

A64684-01

Library

Product

Contents

Index

Prev  Chap Top Next

Introduction

Oracle8i and Oracle SQLJ support user-defined SQL object types (composite data structures), related SQL object reference types, and user-defined SQL collection types. Oracle objects and collections are composite data structures consisting of individual data elements.

Oracle SQLJ supports either strongly typed or weakly typed Java representations of object types, reference types, and collection types to use in iterators or host expressions. Strongly typed representations use a custom Java class that maps to a particular object type, reference type, or collection type and must implement the interface oracle.sql.CustomDatum. This paradigm is supported by the Oracle JPublisher utility, which you can use to automatically generate such custom Java classes. Weakly typed representations use the class oracle.sql.STRUCT (for objects), oracle.sql.REF (for references), or oracle.sql.ARRAY (for collections).

To use Oracle-specific object, reference, and collection types, you must use one of the Oracle JDBC drivers and you must customize your profiles appropriately (the default Oracle customizer, oracle.sqlj.runtime.util.OraCustomizer, is recommended). This is performed automatically when you run SQLJ, unless you specify otherwise.

You also must import the oracle.sql package, as follows (unless you use the fully qualified class names in your code):

import oracle.sql.*;

For Oracle-specific semantics-checking, you must use an appropriate checker. The default checker, oracle.sqlj.checker.OracleChecker, acts as a front end and will run the appropriate checker based on your environment. This will be one of the Oracle-specific checkers if you are using an Oracle JDBC driver.

For information about translator options relating to semantics-checking, see "Connection Options" and "Semantics-Checking Options".


Notes:

  • This chapter primarily discusses the use of custom Java classes with user-defined types; however, they can be used for other Oracle SQL types as well. A custom Java class can be employed to perform any kind of desired processing or conversion in the course of transferring data between the database and Java.

  • Custom Java classes for objects, references, and collections are referred to as custom object classes, custom reference classes, and custom collection classes, respectively.

  • User-defined SQL object types and user-defined SQL collection types are referred to as user-defined types (UDTs).

 




Prev

Top

Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index