aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Database Access Class 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 Access Class" Watch "Database Access Class" New topic
Author

Database Access Class

Mickey Mulligan
Greenhorn

Joined: Feb 26, 2006
Posts: 20
I've been digging into my brand new SCJD assignment (contractor) for the past few hours and I've come up against a little problem. My assignment refers to something called the "Database Access Class". This must implement a certain interface, DBAccess, and be named Data.

I can't work out whether this is supposed to be the class that directly read/writes to the database file or not. Can it use another class to access the database file? I'm looking to do something like...

ContractorInformationManagementFacade has-a Data
Data has-a DatabaseFileReadWriter

Hope I'm making some sense!
Petr Hejl
Ranch Hand

Joined: Feb 26, 2006
Posts: 68
I think you can use any subclass or delegation as far as your class with given name will implement required interface. There is no requirement on how to do it.

But I would ask some more general question. I think it is really not clear in assignment. How should client/server interface should be done. I figured out two options:

a) data interface is also a interface between client and server (some statements in assignment seems to require this, but not in clear way..). Then I will have to implement some lock cleaning mechanism and bussines logic will be on client side

b) interface between client and server is provides bussiness methods (book() for example) that calls some sequences on data interface. This would not require lock clean up code because bussines methods would be located on server. But database interface itself will not be available through network.

Which solution is supposed? Which is better?

Thanks Petr
Bob Nedwor
hangman
Ranch Hand

Joined: Aug 17, 2005
Posts: 215

Mickey:
I just a have file called DBAccess.java which is really just an interface with all the methods they descbribe in the instructions, but the methods have no statments, because they are all abstract. The file has a line in it at the beginning like this:

Then I have a file called Data.java which is where I build a class "Data" that implements all these methods. It has a line in it that says:

I hope this helps.
[ February 26, 2006: Message edited by: Bob Nedwor ]

Bob N
SCJP - 1.4
SCJD - (B&S) Used 1.5 And It Runs On Solaris10
SCWCD - Thanks to HFSJ!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Database Access Class