Meaningless Drivel is fun!
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes meaning of data 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 "meaning of data access class" Watch "meaning of data access class" New topic

meaning of data access class

shan chen
Ranch Hand

Joined: Apr 09, 2003
Posts: 70
Hi, I hope someone could help me to clearify the meaning of "data access class". The instruction.html says:
Your data access class must be called "".

Does this mean Data is the only class that DIRECTLY handle database read/write? Data can not call another class to access database?
For example, I want to defind the create method as synchronized, so that it is the method DIRECTLY handle database:
synchronized int createRecord(String []) {}
Its signature is differenct from the create method in Data:
public int create (String [] ) {}

The second method actually calls the first method.
My question: is the following understanding correct?

I CANNOT define another class which contains these synchronized methods, otherwise Data is NOT data access class. I must put the first method within either, as a member method.
Thanks to any suggestion.
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11778

Hi Shan,
Personally I would read data access class as meaning "the class throught which I access the data".
That is, if I want to do a read, I call If I want to do a write, I call Data.write etcetera. I do not (and cannot) call multiple classes to do the same thing.
But I cannot see why the Data class itself cannot call helper classes to do more specific functions. You would need to be careful with those other classes though: if you give them public access, then someone could break your database in scary ways. You would probably only want package level access for them.
Any other opinions?
Regards, Andrew

The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
I agree. Here's the link:
subject: meaning of data access class
It's not a secret anymore!