File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java Micro Edition and the fly likes Update RecordStore Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Update RecordStore" Watch "Update RecordStore" New topic

Update RecordStore

Goran Markovic
Ranch Hand

Joined: Sep 26, 2008
Posts: 399
I was wondering is there an option to do update of the RecordStore, without deleting all it data first.
Example : I have some data in the RecordStore. The data has been retrieved and and changed (some modified, some changed). In order to reflect changes in the RecordStore, as much as I figure out, I must first delete all data, and then populate RecordStore with my data. If I do not do that way, deletion or modification of some data won't be reflected.
Deleting all data from the database, on any change, is expensive for me.

Anybody any suggestion about this?

Thanks in advance
Soumya Rout
Ranch Hand

Joined: Aug 06, 2009
Posts: 49

Updating a particular record involves getting a handle for that record and setting new information.

returns the data stored in the given record in the byte array represented by buffer.

returns a copy of the data represented by recordId.

sets new information,

a stream of bytes (newData) with offset as its starting index and numBytes as its length,
at the record location represented by recordId.

Goran Markovic
Ranch Hand

Joined: Sep 26, 2008
Posts: 399
Hi Soumya,
that solution include Id tracking of particular record, which are constructed as an objects after retrieval. But even in that case, it is not good solution (at least not best for now) because, I must check about id event the objects which are deleted, just as about new objects, I am attempting to add into RecordStore. That means, I always must perform comprehensive check of list of objects for changes... I believe it will take almost the same time for checking each object from the list to see is it changed, deleted or some new is added, and then if so (let say 90% got modified), I need to save it.
I agree. Here's the link:
subject: Update RecordStore
It's not a secret anymore!