Hi,Philippe: In my DBAccess interface define follow: public String  readRecord(long recNo) but in my DB file does not have the recNo, How to get the recNo? Is the recNo means a record's id? if yes,but no fields(name,location,specialties,size,rate,owner) to storage it in the DB.
posted 13 years ago
Hi Jofer, recNo is just a record number. The first one is numbered 0 (or possibly 1 or as you like - check your instructions). After having read the file header, you should know (directly or by computation) :
where the data section (the actual records) starts (dataSectionOffset below)
the length of each record
So, to read any record in the case your records are numbered starting with 1, you must read the file starting at position (dataSectionOffset + (recNo - 1) * recordLength), up to that position + recordLength. In the case your records numbers start with 0, the formula above becomes (dataSectionOffset + recNo * recordLength).
How to get the recNo?
Your application will get them as return values of your find() method. Best, Phil. [ October 24, 2003: Message edited by: Philippe Maquet ]
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads