my dog learned polymorphism*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes How to comprehend such a method in URLyBired? 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 "How to comprehend such a method in URLyBired?" Watch "How to comprehend such a method in URLyBired?" New topic
Author

How to comprehend such a method in URLyBired?

Zhixiong Pan
Ranch Hand

Joined: Jan 25, 2006
Posts: 239
Hi ranchers,
I am still unclear about such a method in my URLyBird assignment.The method is in Data.java which implements interface DB.

// Modifies the fields of a record. The new value for field n
// appears in data[n]. Throws SecurityException
// if the record is locked with a cookie other than lockCookie.
public void update(int recNo, String[] data, long lockCookie)
throws RecordNotFoundException, SecurityException{

}

Can anyone give me some illumination?


SCJP 1.4 SCJD
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11404
    
  81

Hi Zhixiong,

Perhaps some more information on where you are having difficulties would help get answers?

A client will call the update method when it wants to modify a record. The update method will check that the recNo has been locked, and that the lock is owned by lockCookie. If so, then it overwrites the recNo record in the database with the data provided.

Does this help? If not, can you provide more information on what is unclear?

Regards, Andrew


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Zhixiong Pan
Ranch Hand

Joined: Jan 25, 2006
Posts: 239
Hi Andrew,
Your answer is very clear, and I understand indeed now.Meanwhile I have a problem about multi-client designing which i have posted a new post. If you have time to read it, it would be very kind of you.
 
Don't get me started about those stupid light bulbs.
 
subject: How to comprehend such a method in URLyBired?
 
Similar Threads
Who to treate lockCookie in URLyBird?
update method not throws DuplicateKeyException!
Is checking for SecurityException in updateRecord method necessary?
Cookie value used in DBAccess Interface
Can I use another db file for optimistic locking?