The moose likes Developer Certification (SCJD/OCMJD) and the fly likes question on create() methond 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 "question on create() methond" Watch "question on create() methond" New topic

question on create() methond

fei lin
Ranch Hand

Joined: Nov 25, 2007
Posts: 39
in my interface i have:
public int create(String [] data) throws DuplicateKeyException;

if i decided to use record number as my primary, I will always let user enter insert a row to db even though its same data(same name, location etc...) is it acceptable?
Alex Belisle Turcot
Ranch Hand

Joined: Apr 26, 2005
Posts: 516
It is very acceptable to me.. There could be 2 "Bob Smith" in "Montreal"..

My decision was to not interfere with this. I thought, from reading the assignment, that there were no requirement asking for any restriction on this, so following that logic, I thought it would actually be wrong to do so.

But I've read others used some fields as the key as well. It's really of matter of making your own choice.

I agree. Here's the link:
subject: question on create() methond
It's not a secret anymore!