• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Database design

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


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
 
Good heavens! What have you done! Here, try to fix it with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic