• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

(B&S) Question regards Data File

 
Saheed Adepoju
Ranch Hand
Posts: 267
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys!
I was wondering, the customer if value(an 8 digit number) in the instruction, how are we suppose to read it! I read it like i did the rest of the fields; that is i created an array of byte[8]! Then i convert it to a string. When i display the contents, it is actually blank, which signifies that the record is available for booking(In fact all the record i displayed are available for booking!)! My question is, is it correct to create a byte[8] and not use raf.readLong()?Thanks!
 
Ailsa Cape
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,Saheed

I gave a little flexibility in designing the section of database for future enhancement. Instead of hardcoding the owner filed length, you can read the schema header of the database file firstly. When you get each field length, you can use the following pseudocode lines:


If the schema of the DB file changed in the future, using the above code can easily adapt the transformation.

Hope this would be helpful.
Happy New Year!
Regards, Ailsa Cape
 
Saheed Adepoju
Ranch Hand
Posts: 267
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
Happy new year Alisa and thanks for your input! Actually i was wondering whether the customer id value in the database file was in a string format or in number format! I read it as a string format and there was no problem whatsoever in doing that! It turned out that all the owner field of the database file was empty signifying that they the records were available for booking!Anyways my conclusion is that they are in string format! Thanks anyway! Happy new year all!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic