42
SCJP 1.4 91%, SCJP 1.5 88%, SCJD B&S
Robert
Originally posted by Sham Delaney:
I keep all the data in a cache. And dont write to the DB after each update/delete. I wait and write out all the records at specified intervals.
The cached data is the db and it is current..i write to the db file as backup.
Should I be updating constantly to the DB file ?
SCJD<br />SCJP 1.4
42
42
42
Originally posted by Sham Delaney:
In my Database file..it seems like spaces fill the gaps at the end of each field. When Writing these fields back out to the database..I am following the approach Andrew made in his book. Instead of writing out spaces to fill the gap, I write out the field...and skip onto the location of the next field.
My code reads in the updated fields no problem...the same as it does for the other fields.
Is it safe to assume that it is ok to do this?
Hmmm - that is not quite what we do. We have a block that is pre-populated with spaces, and so we can put the fields into that block. Then we write the entire block in one step. This saves the problems of counting spaces for each field, and of dealing with individual fields at a file level.Originally posted by Sham Delaney:
Instead of writing out spaces to fill the gap, I write out the field...and skip onto the location of the next field.
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |