wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes B&S: Does DB.read() return Record Number, recNo -- I think not? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "B&S: Does DB.read() return Record Number, recNo -- I think not?" Watch "B&S: Does DB.read() return Record Number, recNo -- I think not?" New topic
Author

B&S: Does DB.read() return Record Number, recNo -- I think not?

Jonathan Wolter
Greenhorn

Joined: Nov 26, 2007
Posts: 12
The interface DB has a read method:


I am not currently returning the recNo in this String[], because the database file itself does not have a notion of record numbers. (They get calculated on the fly by the database implementation).

Would anyone disagree with me on this? Do you think I need to return the recNo in that String array?


jaw
Musab Al-Rawi
Ranch Hand

Joined: Aug 06, 2007
Posts: 231
Hi,

I didn't return the record number in the String[], and I really believe that there is no need to do so.


SCBCD - SCWCD - SCJD - SCJP - OCA
Alex Belisle Turcot
Ranch Hand

Joined: Apr 26, 2005
Posts: 516
Hi,

I agree, no need. Especially since the recNo is passed as argument, so the caller knows which record he's receiving..

Regards,
Alex
Oguz Ozun
Greenhorn

Joined: May 10, 2007
Posts: 19
Originally posted by Jonathan Wolter:
The interface DB has a read method:


I am not currently returning the recNo in this String[], because the database file itself does not have a notion of record numbers. (They get calculated on the fly by the database implementation).

Would anyone disagree with me on this? Do you think I need to return the recNo in that String array?


jaw


I think there is no need but it doesn't violate the specification. You can put this info as the last element of the array. In the specs, at least in mine, there is no constraint about the string array or string array representation of the record.
 
Consider Paul's rocket mass heater.
 
subject: B&S: Does DB.read() return Record Number, recNo -- I think not?