Hi,
I am doing the Bodgitt and Scarper assignment. My question is that recNo in the database interface seems to be a unique identifier for a record in the database.
But what is int recNo, what field does it correspond to in the database schema? The answer is so obvious that I cannot figure it out =)
Example:
Required Interface
Your data access class must be called "Data.java", must be in a package called "suncertify.db", and must implement the following interface:
package suncertify.db;
public interface DB
{
// Reads a record from the file. Returns an array where each
// element is a record value.
public
String[] read(int recNo) throws RecordNotFoundException;
// Modifies the fields of a record. The new value for field n
// appears in data[n]. Throws SecurityException
// if the record is locked with a cookie other than lockCookie.
public void update(int recNo, String[] data, long lockCookie)
throws RecordNotFoundException, SecurityException;
// Deletes a record, making the record number and associated disk
// storage available for reuse.
// Throws SecurityException if the record is locked with a cookie
// other than lockCookie.
public void delete(int recNo, long lockCookie)
And the database schema:
The database that Bodgitt and Scarper uses contains the following fields:
Field descriptive name Database field name Field length Detailed description
Subcontractor Name name 32 The name of the subcontractor this record relates to.
City location 64 The locality in which this contractor works
Types of work performed specialties 64 Comma separated list of types of work this contractor can perform.
Number of staff in organization size 6 The number of workers available when this record is booked
Hourly charge rate 8 Charge per hour for the subcontractor. This field includes the currency symbol
Customer holding this record owner 8 The id value (an 8 digit number) of the customer who has booked this. Note that for this application,
you should assume that customers and CSRs know their customer ids. The system you are writing does not interact with these numbers, rather it simply records them. If this field is all blanks, the record is available for sale.