posted 12 years ago
Hi all,
This is my first post with questions.
I basically tried to use database reader files that Roberto, Roel and someone else here shared in this forum
and I have been tweaking things around to fit my requirement but I am not having much of luck progressing further with the implementation.
After running the application in debug mode, I found that I am getting false value of record length to start with
and it affects my find() method run in unexpected sequence and therefore I get no data record display in the table.
Can anyone please spot me where I am doing it wrong?
I am not an experienced developer and I have no friend around who has programming knowledge.
I have read through my assignment requirements many times and referred to faq page here but cannot find myself a solution.
Your tip of advice will be very much appreciated!
This is the data file format that is given to me.
******************************************************************************
Data file Format
The format of data in the database file is as follows:
Start of file
4 byte numeric, magic cookie value. Identifies this as a data file
4 byte numeric, offset to start of record zero
2 byte numeric, number of fields in each record
Schema description section.
Repeated for each field in a record:
2 byte numeric, length in bytes of field name
n bytes (defined by previous entry), field name
2 byte numeric, field length in bytes
end of repeating block
Data section. (offset into file equal to "offset to start of record zero" value)
Repeat to end of file:
2 byte flag. 00 implies valid record, 0x8000 implies deleted record
Record containing fields in order specified in schema section,
no separators between fields, each field fixed length at maximum specified in schema information
End of file
All numeric values are stored in the header information use the formats of the
DataInputStream and DataOutputStream classes.
All text values, and all fields (which are text only), contain only 8 bit characters,
null terminated if less than the maximum length for the field.
The character encoding is 8 bit US ASCII.
******************************************************************************
This is my data constructor
[edit] do not post complete snippets of actual code