Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

writing record to database

 
Kevin Mc Cusker
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Im having a small problem. Basically I have 6 String which represent a record I want to write to the database.
I declare a byte aray the exact length that i need but arent sure of the best approach to get my strings at the exact positions in the array that are required.
For example, String2 needs to start at pos 32, but String1 is only 10 characters long.
Even then im not sure how to write to the file.

Any help is welcome.
 
ak pillai
author
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are other ways to do it. but since you asked for Strings and byte array approach, I have done with char array so that it can be printed. you can easily change the char array to a byte array.



For byte array replace the bold face lines with:

//second instance of bold


Hope this helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic