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 Dsign Issues in B&S Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Database Dsign Issues in B&S" Watch "Database Dsign Issues in B&S" New topic
Author

Database Dsign Issues in B&S

Muhammad Shafique
Ranch Hand

Joined: Sep 30, 2006
Posts: 59
Hi there,
I am working on B&S database. There are some confusions and which I want to discuss there.
In database interface, find method has description like:

// Returns an array of record numbers that match the specified
// criteria. Field n in the database file is described by
// criteria[n]. A null value in criteria[n] matches any field
// value. A non-null value in criteria[n] matches any field
// value that begins with criteria[n]. (For example, "Fred"
// matches "Fred" or "Freddy".)
public int [] find(String [] criteria) throws RecordNotFoundException;

Could anybody please explain this �criteria� further? What is record number? Is it index of record in file because apparently there is no key field in record and I must not add or remove any field because of compatibility with existing data?

In the same interface, delete method has description like this:
// Deletes a record, making the record number and associated disk
// storage available for reuse.
public void delete(int recNo) throws RecordNotFoundException

But in database file format description, it is written that records are not deleted physically they are only marked as deleted (00 implies valid, 0xFF implies deleted). This is really confusing!! Please help!!

Shafique
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Can I suggest that you spend some time (some people spend a few weeks) browsing back through earlier topics in this SCJD forum. I'm quite sure your questions have already been answered.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Database Dsign Issues in B&S