Anita S�rensen

Greenhorn
+ Follow
since Oct 17, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Anita S�rensen

I have a Data class that directly implements all methods in the DBAccess, exept the locking mechanisms. To keep OO principles, and create clean code, I seperated locking mecanisms into a locking manager. The locking uses a hashmap to keep track of the locked records, and the entire Data class don't need this information.
With all programming, reading and preparation I used 6 weeks working 8 to 4.
I to have the same problem. All reading and updating is successfull, all the data that I see in the database file is read and displayd, but I still get that EOFException.
I don't think this is a problem.

I have done a similar approach as archana. I have the B&S assignment and has a higher level 'data modificator' on the server side. I only return serialized value objects to client, not anything directly from Data.java. The assignment only states that Data.java has to be the data access class, and don't say that this has to be communicating with the client.
What the assignment states MUST ble included in the section describing "The User Interface" is, well, what you MUST implement. Functionality beyond this is on your own, but remember that you don't get ekstra marks on functionality they don't ask for. Actually a more complex application may make you loos marks. Keep it Simple and it is probabply okey.

I have not implemented any extra functionality into the GUI, but I think you can if you want to.
I have implemented a high level data access class that uses data.java for direct database access, and it seems that this is a very common solutions. I don't think you have to worry as long as you remember to document your desitions.
I am working on a B&S assignment and wonder if anyone has done any assumtions similar to the one I'm thinking of.

The description of the User Interface states that it MUST satisfy the following criteria:

  • It must be composed exclusively with components from the Java Foundation Classes (Swing components).
  • It must allow the user to search the data for all records, or for records where the name and/or location fields exactly match values specified by the user.
  • It must present search results in a JTable.
  • It must allow the user to book a selected record, updating the database file accordingly.


  • My interface that MUST be implemented consists of the following methods:

  • public String [] readRecord(long recNo)
  • public void updateRecord(long recNo, String[] data, long lockCookie)
  • public void deleteRecord(long recNo, long lockCookie)
  • public long[] findByCriteria(String[] criteria)
  • public long createRecord(String [] data)
  • public long lockRecord(long recNo)
  • public void unlock(long recNo, long cookie)


  • I'm thinking, in my terms implementing an interface doesn't neccesary mean implementing logical code to the methods. The gui, or any describable must-functions, don't require the delete method or the create record to be functional. I'm thinking than on assumtion then can be that these function is handled by e.g. another application not communication with the assignment application. What considerations has other people here done with this aspect??
    I study as I do the assignment. Of course, this may lead to huge changes it the project code if you discover desing errors as you learn, but if this doesn't bother you I recommend this approach :-)
    My record number (recNo in interface) is not integer but long. There is no description of record number in the interface. I still can't see why this HAS to be the order in the database...

    Other opinions?
    In my B&S assignment the Interface states that I have to use a recNo for identifying records. I can not find any "must" statements on what this recNo actually represent. So far I have used recNo as the offset of a record, and implemented it as a member in Contractor to preserv it. I do not wish to use a Map or similar to map between record offsets to e.g. number 1,2,3 as these numbers are not necessary for any logcal code.

    Is this an ok solution? What has others done?
    When updating the database the original empty spaces between fields changes to "squares" in the database display in WordPad (Not in Notepad). Does it mean anything or is it just somthing I can ignore?

    I'm using


    and