// Reads a record from the file. Returns an array where each // element is a record value. public String read(int recNo) throws RecordNotFoundException; what's the meaning of recNo?i think that is the position in the physical file.so it's not unique because this recNo can be reused. so in the update synchronized block,we need to compare each field in the record to confirm the record state.and the client must send back all the field of the record which be booked? It's truth? i want a Positive response! thanks!
We don't have many rules here, but one we do have is the JavaRanch Official policy on registered names which requires the display name to be a real name. Please read this policy document and change your display name to meet the requirements. You can change your display name here.
Can't understand ur question clearly. recNo is just a number which indicates position of record. to get the actual record you use something like this
dbFile.seek((recNo-1) * recordLength); keep the recordLength calculated in the beginning only. assuming recNo starts from 1... in update method when you pass the recNo seek the location of file using the above code and write the content in form of bytes. if its a string then use. dbFile.write(contentString.getBytes());