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. 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 Employee 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, just drag and drop the employees relationship in the master DBModule onto the icon of the detail module in the NIB file. 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.\