File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes database - help 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 - help" Watch "database - help" New topic
Author

database - help

kevin mc cusker
Greenhorn

Joined: Jun 06, 2004
Posts: 2
Hi,
Im a little confused about the database part.
I have read the data from the file using raf. Do i save this to a vector and then just use this vector for all my operations, ignoring the db file from there on, or do i need to update the actual db file via the vector ie GUI<->vector<->bd file. Any suggestions on how to implement this would be welcome. Thanks.
Hanna Habashy
Ranch Hand

Joined: Aug 20, 2003
Posts: 532
hi Kevin:
You can do it either way, it depends on you data access design. If you choose to cach the database record in memory, i.e. using collections, you cannot ignore the database file. You need to update the database accordingly. So you have to make sure that what you have in memory cach is what you have in the file, this is called data integrity.
[ June 06, 2004: Message edited by: Hanna Habashy ]

SCJD 1.4<br />SCJP 1.4<br />-----------------------------------<br />"With regard to excellence, it is not enough to know, but we must try to have and use it.<br />" Aristotle
kevin mc cusker
Greenhorn

Joined: Jun 06, 2004
Posts: 2
cheers hannah,
when two clients load the data to a collection, one updates the db file, then the other client has out of date information.
Should i have the collection on the server, with everyone using that to search etc? Also, is it ok to have each record as one large string or should i divide the record into for example, name, address etc?
Hanna Habashy
Ranch Hand

Joined: Aug 20, 2003
Posts: 532
Kevin:
These are design choices that you have to make, and then explain in your written exam. All these options are valid options, it is up to you to choose one. I will tell you what I did myself, but this is just my choice.
I don't cach the data, instead I access the database file every time data is required. I keep a static collection to control the lock mechanism.
I read about many diffrent interesting designs in this forum, and all of them are valid ones.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: database - help
 
Similar Threads
Connection pooling using Tomcat
What do we mean by this?
ResultSet Data Manipulation
about B&S database file
Value in dropdown from servlet