• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

URLyBird what do you use as recNo

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Leah,

First of all welcome to the JavaRanch!

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

Kind regards,
Roel
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 759
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I use the records number in order they are appear using 1-based number.


Jeffry Kristianto Yanuar

SCJP, SCJA, SCJD
 
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Jeffry Kristianto Yanuar
Ranch Hand
Posts: 759
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
reply
    Bookmark Topic Watch Topic
  • New Topic