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
2 byte numeric, number of fields in each record
Schema description section.
Repeated for each field in a record:
1 byte numeric, length in bytes of field name
n bytes (defined by previous entry), field name
1 byte numeric, field length in bytes
end of repeating block
Data section.
Repeat to end of file:
1 byte flag. 00 implies valid record, 0xFF 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
Database schema
The database that URLyBird uses contains the following fields: Field descriptive name Database field name Field length Detailed description
Hotel Name name 64 The name of the hotel this vacancy record relates to
City location 64 The location of this hotel
Maximum occupancy of this room size 4 The maximum number of people permitted in this room, not including infants
Is the room smoking or non-smoking smoking 1 Flag indicating if smoking is permitted. Valid values are "Y" indicating a smoking room, and "N" indicating a non-smoking room
Price per night rate 8 Charge per night for the room. This field includes the currency symbol
Date available date 10 The single night to which this record relates, format is yyyy/mm/dd.
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.
Fernando Franzini - Java Blog
Offset in bytes | Hex values | Ascii equivalent | |
---|---|---|---|
0000000 | 0000 0101 0000 9f00 0700 0400 616e 656d | nul nul soh soh nul nul nul 9f nul bel nul eot n a m e | |
0000020 | 4000 0800 6f6c 6163 6974 6e6f 4000 0400 | nul @ nul bs l o c a t i o n nul @ nul eot | |
0000040 | 6973 657a 0400 0700 6d73 6b6f 6e69 0067 | s i z e nul eot nul bel s m o k i n g nul | |
0000060 | 0001 7204 7461 0065 0008 6404 7461 0065 | soh nul eot r r a t e nul bs nul eot d a t e nul | |
0000100 | 000a 6f05 6e77 7265 0800 5000 6c61 6361 | nl nul enq o w n e r nul bsnul P a l a c | |
0000120 | 2065 2020 2020 2020 2020 2020 2020 2020 | e sp sp sp sp sp sp sp sp sp sp sp sp sp sp sp | |
0000140 | 2020 2020 2020 2020 2020 2020 2020 2020 | sp sp sp sp sp sp sp sp sp sp sp sp sp sp sp sp | |
0000200 | 2020 2020 2020 2020 2020 5320 616d 6c6c | sp sp sp sp sp sp sp sp sp sp sp S m a l l | |
0000220 | 6976 6c6c 2065 2020 2020 2020 2020 2020 | v i l l e sp sp sp sp sp sp sp sp sp sp sp | |
0000240 | 2020 2020 2020 2020 2020 2020 2020 2020 | sp sp sp sp sp sp sp sp sp sp sp sp sp sp sp sp | |
0000300 | 2020 2020 2020 2020 2020 3220 2020 5920 | sp sp sp sp sp sp sp sp sp sp sp 2 sp sp sp Y | |
0000320 | 3124 3035 302e 2030 3032 3530 302f 2f37 | $ 1 5 0 . 0 0 sp 2 0 0 5 / 0 7 / | |
0000340 | 3732 2020 2020 2020 2020 4300 7361 6c74 | 2 7 sp sp sp sp sp sp sp sp nul C a s t l |
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Fernando Franzini - Java Blog
SCJP, SCJD
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Cheers, Roberto Perillo
SCJP, SCWCD, SCJD, SCBCD
phung duc tho wrote:Can you upload db file
Cheers, Roberto Perillo
SCJP, SCWCD, SCJD, SCBCD
Consider Paul's rocket mass heater. |