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;}
| Java Programming with Oracle SQLJ | | | Copyright | | | Table of Contents | | | Preface | | | 1. Introduction | | | 2. Relational Databases, SQL, and PL/SQL | | | 3. Fundamental SQLJ Programming | | | 4. Database Objects | | | 5. Collections | | | 6. Deploying SQLJ in the JServer | | | 7. Large Objects | | | 8. Contexts and Multithreading | | | 9. Advanced Transaction Control | | | 10. Performance Tuning | | | 11. Combining JDBC, SQLJ, and Dynamic SQL | | | A. Java and Oracle Type Mappings | | | B. Oracle Java Utilities Reference | | | C. SQLJ in Applets, Servlets, and JavaServer Pages | | | Colophon | | | Index | | | Database > Java Programming with Oracle SQLJ > 5. Collections | Chapter 5. CollectionsTraditionally, 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. |
Index terms contained in this section collections types master-detail relationship | |