File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes DB Interface and implementation. 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 "DB Interface and implementation." Watch "DB Interface and implementation." New topic

DB Interface and implementation.

Pankaja Bansal

Joined: Feb 16, 2006
Posts: 19

Your data access class must be called "", must be in a package called "suncertify.db", and must implement the following interface:

package suncertify.db;
public interface DB
{.... }

Since the DB interface here contains lock and unlock mechanism, I created a wrapper class around my class which locks, performs the operation and unlocks the object. Since the connection could be local or remote, my client would require to deal with an interface. My question now is, is it mandatory to use this given interface "" for clients use or can I create another interface which my wrapper class would implement and this interface would actually be passed to client for all its operations.

I dont want client to be handling lock and unlock processes and all the client should be bothered of is operations on the database. Can my approach fail automatic test because I'll be using another interface apart from DB for the client to access data ?

Please let me know your views.

Eiji Seki
Ranch Hand

Joined: Feb 15, 2006
Posts: 88
Well, I guess you can use your own interface, since the spec only requires your class to implement it, not you to use it.
Probably they will use it to run your data layer on a automated evaluation.

SCJD URLyBird (WIP)<br />SCJP 1.5
I agree. Here's the link:
subject: DB Interface and implementation.
It's not a secret anymore!