This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

B&S: Record Numbers

 
Talib Ali
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!

Sorry if this topic has already been discussed I searched but could not find it.

According to given DBAccess interface it is required to use "long record Number" on multiple places. The provided database has no record Number field, atleast i think this.

As we have to reuse this (long)record Number value so i could not understand where i have to store it. do i have to make a new field in the provided database file or is there any way to manage it without altering the current database file.

I will be very thankful for your response in this regard.
[ March 01, 2008: Message edited by: Talib Ali ]
 
mohamed sulibi
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi;

You not allowed to alter any things in the provided DB file. so you can
consider the relative position in the file as record number.
ex : start data section == record number 0.
start data section + (( size of the record ) * record number ) = record number data.

i get this information from this forum. there are many topics on this issue.

best regards.
Mohamed Darim.
 
Talib Ali
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Sulibi, I think its the easiest solution.

Its one drawback that can messup is that after getting maximum limit (long) it'll start in negative numbers.

I think some material passed under my eyes where people used Hashmap or System.currentTimeMillis() for forming recNo. I dont know the exact reason of this logic.

Best Regards!
 
Joe Math
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No Probs, You can edit the DB file, provide you should mention that in your documentation why && what you done soo.

Its basically a decision making scenario where you need to decide, in real time projects.

thanks,
Joe.
SCJP, SCJD, SCWCD.
 
Talib Ali
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks! for feedback
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic