typedstream IBObjectData Object CustomObject Application Responder ScrollView ClipView ciifffcfffs [3316c]{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} \margl40 \margr40 {\colortbl;\red0\green0\blue0;} \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b\i0\ulnone\fs36\fc0\cf0 OracleDemo \b0\fs24 \ by Mai Nguyen, NeXT Developer Support Team\ \b\fs28 Overview \b0\fs24 \ The purpose of this example is to show some common end-user operations in handling databases \b without any need for Database Kit programming. \b0 \ In order to run this example, you need to have an Oracle server with a demo database installed. You also have to install the \b OracleDemo.dbmodel \b0 from /NextDeveloper/Examples/DatabaseKit/models into your \b ~/Library/Databases \b0 directory, in order to establish the proper connections between the database model and the Database Kit UI Objects. If you don't have an Oracle server, you can still follow the instructions on building the nib files to quickly put together a demo.\ In order to add a new record either into the employee table or the department table, press on the appropriate \b Insert \b0 button and type in the data into the tableview textfields. After each \b Insert \b0 operation, you need to explicitly \b save \b0 the record. Note that the unique keys for the Em ee Record is the Employee ID, while the unique key for the Department Record is the Department No. Similarly, after a \b delete \b0 operation, you'll need to explicitly \b save \b0 the changes.\ \fc1\cf1 \ \b\fs28 Program Organization \b0\fs24 \ \b How to build the nib files\ 1) Build the Master TableView \b0 \ Drag a DBTableView palette object into your main window. Drag a DBModule object into the IB suitcase. Select OracleDemo as the database model. Make the proper connections from the Deparment table to the DBTableView. Set the DBTableView to be editable via the Interface Builder Inspector Panel, so that data can be entered directly into its textfields.\ \b 2) Build the Detail TableView\ \b0 Same steps as for the Mater TableView. The only difference is that you need to drag another DBModule object into the IB suitcase, and make the proper connections from the Employee table to the DBTableView.\ \b 3) Join the 2 tables \b0 \ In order to join the 2 tables, drag and drop the employee table from the detail DBModule into the master DBModule. Note that employees will show up as a new connection of the Master DBModule under the Interface Builder Inspector Panel.\ \b 4) Build the buttons\ \b0 Note that the Fetch operation needs to be connected to the fetchAllRecords of the Master DBModule.\ Each TableView has its own insert, delete, and save to save the records corresponding to that particular table.\ \pard\tx560\tx1120\tx2060\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\fi-2060\li2060\fc1\cf1 \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b\fc1\cf1 Other Peculiarities \b0 \ In order to load an Adaptor dynamically, you need to add the \b OTHER_LDFLAGS \b0 definition (see the \b Makefile.preamble \b0 ). You also need to add the \b libdbkit_s.a \b0 library into your \b PB.project \b0 under \b libraries \b0 in order to use the DBKit API. \ \b Note: \b0 You can use this NIB file as is without any coding for demo purposes and run it using IB Test Interface Mode. NXCursor NXImage NXibeam Scroller Control _doScroller: @@@ffs WindowTemplate iiii***@s@ README Panel leVector iiff*@@@ empID Helvetica-Bold DBEditableFormatter DBFormatter Helvetica TextFieldCell ActionCell DBTableView [11@] Button ButtonCell Insert New Employee Delete Employee Record Save Changes in Employee DBGridView i@@@@@ DBLayout @@ffcii deptNo DBHeadingView i@@@@@:: Fetch All Records Delete Department Record Save Changes in Department TextField Department Table (Master) Employee Table (Detail) Insert New Department empName Master-Detail Window MenuCell README... Matrix @:@iiii Hide< Quit< ff@@#::s MenuTemplate *@*@ccc MasterDetail= DBModuleTemplate DBModule OracleDemo Employee Department Controller View11 MainMenu File's Owner View1 [19@] IBControlConnector IBConnector terminate: hide: DBTableConnector DBConnector fetchAllRecords: deleteRecord: saveChanges: insertNewRecord: employees IBOutletConnector delegate RMPanel theWindow orderFront: