wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes What's the key for the Database? 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 "What Watch "What New topic
Author

What's the key for the Database?

Richard HWang
Greenhorn

Joined: Mar 15, 2004
Posts: 3
It throws a DuplicateKeyException in createRecord method of interface DBAccess, but there is no further information about the key of the database
in the instruction.
When should I throw the exception? If all fields of the new record is match some record in the database file or if a key field match? and what's the key field you select? many many thzZZZzzz
George Marinkovich
Ranch Hand

Joined: Apr 15, 2003
Posts: 619
Hi Richard,
Originally posted by Richard HWang:
It throws a DuplicateKeyException in createRecord method of interface DBAccess, but there is no further information about the key of the database
in the instruction.
When should I throw the exception? If all fields of the new record is match some record in the database file or if a key field match? and what's the key field you select? many many thzZZZzzz

Well, it depends on your particular assignment. For the URLyBird assignment I have heard it argued that there is no key for the database. I haven't read the assignment instructions for URLyBird so I can't independently confirm this, but the arguments have seemed reasonable that a key doesn't really exist in that case. My assignment was B&S Contractors and for that assignment I would argue that name+location comprises the key. So I prohibited the user from creating a record that duplicated an existing name+location combination.


Regards, George
SCJP, SCJD, SCWCD, SCBCD
Richard HWang
Greenhorn

Joined: Mar 15, 2004
Posts: 3
My assignment is URLBird 1.2.3. I think the Hotel Name & City as a key maybe OK, but not so sure.
Satish Avadhanam
Ranch Hand

Joined: Aug 12, 2003
Posts: 697
Hi Richard
Originally posted by Richard HWang:
My assignment is URLBird 1.2.3. I think the Hotel Name & City as a key maybe OK, but not so sure.

Mine is also URLyBird. But am not using any key for the db. I have gone through many designs here, but I do not remember anyone has used a key for this assignment till now. Maybe someone has used, I don't know. If so, they can give their opinion on this. Thanks.
Good Luck.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What's the key for the Database?