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 how to get Record ID in RMS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "how to get Record ID in RMS" Watch "how to get Record ID in RMS" New topic

how to get Record ID in RMS

Harish Tiruvile
Ranch Hand

Joined: Dec 01, 2005
Posts: 99

In RMS is there any way to retrieve particular Record's record ID in a RecordStore.

for example::
I have created a RecordStore which will hold Names.After entering names into RecordStore if i want to modify a particular record i need RecordId allocated for that perticular Record...As we know that it is unpedictable to guess RecordID because it may not take 0,1,2, on consecutive numbers as RecordID

Giving up is the easiest thing in the world to do..but holding it together when everything seems like falling apart is true strength!!
with regards, Harish.T
Theodore Casser
Ranch Hand

Joined: Mar 14, 2001
Posts: 1902

I suppose it really depends on how you're doing it.

You could always get a RecordEnumerator with an appropriate RecordFilter and RecordComparator to look through the RMS to find the one you're looking for. Or, if it won't be too ungainly, you can do what I did with one app, and keep a lookup table of the record IDs in your application (I did this due to the possibility of frequent updates of information, to spare myself having to write searches as I was doing it quick-and-dirty).

But no, you're correct that you can't assume that it's consecutive.

Theodore Jonathan Casser
SCJP/SCSNI/SCBCD/SCWCD/SCDJWS/SCMAD/SCEA/MCTS/MCPD... and so many more letters than you can shake a stick at!
I agree. Here's the link:
subject: how to get Record ID in RMS
jQuery in Action, 3rd edition