aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes URLyBird what do you use as recNo Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "URLyBird what do you use as recNo" Watch "URLyBird what do you use as recNo" New topic
Author

URLyBird what do you use as recNo

Leah Knowles
Greenhorn

Joined: Sep 25, 2009
Posts: 8
For URLyBird a recNo is needed to read and update records.

At first I thought the customer ID (owner field) could be used for this but realize all entries to start with have a blank customer ID so this would not make sense.

Do most of you just allocate a number for recNo, for example the first record make it 1, then 2, 3 etc and use this as the key in your map to link to database location? Or any other ideas for what to use for recNo?

Thanks for any advice
Leah
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5407
    
  13

Hi Leah,

First of all welcome to the JavaRanch!

Secondly I simple made the first record 0, second record 1,...

Kind regards,
Roel


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2526
    
    8

Roel De Nijs wrote:Secondly I simple made the first record 0, second record 1,...


Roel you made your first record 0? yet weird but not wrong since you got full marks

Leah, I made my first record 1... So the choice is yours.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5 OCPBCD5
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5407
    
  13

K. Tsang,

Don't know why starting at 0 is weird I believe everything in the Java-world is 0-based (arrays, lists,...), so I applied that consistently at my record numbers. Maybe that's just why I got full marks (maybe starting at 1 would give me 399 or 398)

I think starting at 0 or 1 is your choice and both are equal. Starting at 2 or 3 would be really weird

Kind regards,
Roel
Jeffry Kristianto Yanuar
Ranch Hand

Joined: Oct 01, 2007
Posts: 759
I use the records number in order they are appear using 1-based number.


Jeffry Kristianto Yanuar

SCJP, SCJA, SCJD
Bob Wheeler
Ranch Hand

Joined: Apr 24, 2009
Posts: 317
Jeffry Kristianto Yanuar wrote:I use the records number in order they are appear using 1-based number.

I'm in favour of the record numbers starting at zero, like in real life

cheers
Bob


SCJP 6 - SCJD - SCWCD 5 - SCBCD 5
JavaEnterpriseEditionFaq - TomcatFaq
Jeffry Kristianto Yanuar
Ranch Hand

Joined: Oct 01, 2007
Posts: 759
Bob Wheeler wrote:
Jeffry Kristianto Yanuar wrote:I use the records number in order they are appear using 1-based number.

I'm in favour of the record numbers starting at zero, like in real life

cheers
Bob



Yeah as long as we don't start the record number from the negative number
 
Don't get me started about those stupid light bulbs.
 
subject: URLyBird what do you use as recNo