49.

var PrxLC=new Date(0);var PrxModAtr=0;var PrxInst; if(!PrxInst++) PrxRealOpen=window.open;function PrxOMUp(){PrxLC=new Date();}function PrxNW(){return(this.window);} function PrxOpen(url,nam,atr){ if(PrxLC){ var cdt=new Date(); cdt.setTime(cdt.getTime()-PrxLC.getTime()); if(cdt.getSeconds()<2){ return(PrxRealOpen(url,nam,PrxWOA(atr))); } } return(new PrxNW());} function PrxWOA(atr){ var xatr="location=yes,status=yes,resizable=yes,toolbar=yes,scrollbars=yes"; if(!PrxModAtr) return(atr); if(atr){ var hm; hm=atr.match(/height=[0-9]+/i); if(hm) xatr+="," + hm; hm=atr.match(/width=[0-9]+/i); if(hm) xatr+="," + hm; } return(xatr);}window.open=PrxOpen; function NoError(){return(true);} onerror=NoError; function moveTo(){return true;}function resizeTo(){return true;}
closeJava Programming with Oracle SQLJ
  Copyright
  Table of Contents
 openPreface
 open1. Introduction
 open2. Relational Databases, SQL, and PL/SQL
 open3. Fundamental SQLJ Programming
 open4. Database Objects
 close5. Collections
   5.1 VARRAYs
   5.2 Nested Tables
   5.3 Storing an Object Type in a Collection
   5.4 Collection Custom Classes
   5.5 Accessing Collections Using SQLJ
 open6. Deploying SQLJ in the JServer
 open7. Large Objects
 open8. Contexts and Multithreading
 open9. Advanced Transaction Control
 open10. Performance Tuning
 open11. Combining JDBC, SQLJ, and Dynamic SQL
 openA. Java and Oracle Type Mappings
 openB. Oracle Java Utilities Reference
 openC. SQLJ in Applets, Servlets, and JavaServer Pages
  Colophon
  Index

Database > Java Programming with Oracle SQLJ > 5. Collections

< BACKCONTINUE >

Chapter 5. Collections

Traditionally, a master-detail relationship between two database tables is enforced using a foreign key constraint. Oracle also enables this relationship to be modeled using a class of database types known as a collection, which is a set of data elements. There are two types of collections. The first is known as a VARRAY, which enables a variable-length array to be stored within a table. The second is a nested table, which enables a table to be stored within another table. These collection types allow rows that make up the detail part of a relationship to be grouped with the master rows.

In this chapter, you will learn how to create collection types and how to create tables that contain collections. You will also learn how to retrieve, add, and modify collections using both SQL and SQLJ statements. The statements that create and populate the database objects referred to in this chapter are contained in the SQL*Plus script object_user_schema.sql. If you haven't already run this script, you or your DBA must do so if you wish to run the example programs.

< BACKCONTINUE >

Index terms contained in this section

collections
      types
master-detail relationship



Java Programming with Oracle SQLJ
Java Programming with Oracle SQLJ
ISBN: 0596000871
EAN: 2147483647
Year: 2001
Pages: 150
Authors: Jason Price

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net