aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Database design Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Database design" Watch "Database design" New topic
Author

Database design

Derick Potgieter
Greenhorn

Joined: Feb 19, 2004
Posts: 13
Hi,

I`m having a problem with the whole database consept.
I`m doing the urlybird exam. I would like to know if this is the right way or one of them, please.

First i create a RandomAccessFile on the database (raf). (should i use buffers, channels or just strait RAF). Then i read in all the headers.
when i get to the data section. Do i just read in all the data byte by byte or is there an easyer way??

after i read the whole record 1, should i load it into an arraylist or vector?? Should i load all the records into this array?? I would think to manage the clients that access the records and "lock" access to these records it could be done in the array.

Would it be better to access the database directly, or going thro an array and then writing the data to the database??

Thanks for any response.

Derick Potgieter
Jon Entwistle
Ranch Hand

Joined: Feb 20, 2003
Posts: 118

should i use buffers, channels or just strait RAF

Channels and rafs are both defendable. I prefer raf for its methods.


Do i just read in all the data byte by byte or is there an easyer way??

Look at the raf methods in the javadocs


after i read the whole record 1, should i load it into an arraylist or vector??


You need to choose and defend your choice. Remeber that arrayList is not threadsafe unless you take steps to make it so.


Would it be better to access the database directly, or going thro an array and then writing the data to the database??


Not too clear what you mean. If you mean using a cache to increase efficiency against writing directly to a file, there are advantages and disadvantages to both approaches. Do a search on this forum for cache.

HTH

Jon


SCJD, SCEA
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Database design
 
Similar Threads
Locking Question
usebean getProperty and setProperty in the same form field
Synchronization of public methods in DVDDatabase
End of file indication
record cache