This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes B&S: Record Numbers 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: Record Numbers" Watch "B&S: Record Numbers" New topic
Author

B&S: Record Numbers

Talib Ali
Greenhorn

Joined: Feb 23, 2008
Posts: 8
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

Joined: Sep 04, 2005
Posts: 169
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

Joined: Feb 23, 2008
Posts: 8
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

Joined: Jun 01, 2007
Posts: 4
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

Joined: Feb 23, 2008
Posts: 8
Thanks! for feedback
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: B&S: Record Numbers