1.I am not sure if my implementation to open the RandomAccessFile is ok.
I have a separate class, DataInfo with only static variablen and methods to read the lenght of fields, header etc. I have also a static getRaf() method
witch returns new RandomAccessFile(dbFile, "rw"); I use this method every time I need the raf.
My find method returns the records depending on the exactMatch flag. The default is true. I have another constructor in the Data class with an additional boolean parameter to can set the exactMatch to false. In the case that the client will be later extended to search for inexact matches, than this constructor has to be used. Is this OK?
// 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 long[] findByCriteria(String[] criteria);
3. It is necessary to implement the create and delete methods? In GUI I don't need them. For the update method I have to update besides the owner field also the other fields? It is possible only to update the owner.
,your implementation of the DBAccess interface should be according to the method comments provided in the interface
Originally posted by Maria Lepschy:
But for me is not clear that I can use a Adapter class because in my instructions stays: "Your data access class must be called "Data.java" ".
That means, from the gui I have to call the Data class and not another class. Please clarify me.
Regards, George
SCJP, SCJD, SCWCD, SCBCD
Originally posted by Maria Lepschy:
Now I think if I have in GUI two not editable comboboxes where the user can select the name and location entirely written, it is not necessary to adapt the method to search for only exact matches.
What do you think? Is this enough?
Regards, George
SCJP, SCJD, SCWCD, SCBCD
1.I am not sure if my implementation to open the RandomAccessFile is ok.
I have a separate class, DataInfo with only static variablen and methods to read the lenght of fields, header etc. I have also a static getRaf() method
witch returns new RandomAccessFile(dbFile, "rw"); I use this method every time I need the raf.