*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "question on create() methond" Watch "question on create() methond" New topic
Author

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.

Regards,
Alex
 
Consider Paul's rocket mass heater.
 
subject: question on create() methond
 
Similar Threads
Inserting BLOB data
locking
Inconsistant Data Updation problem in WEB application(Multiuser Application)
webservice
NX:should lock the database during the creating?