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 problem with read records in RMS after delete Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "problem with read records in RMS after delete" Watch "problem with read records in RMS after delete" New topic

problem with read records in RMS after delete

Charline Louis

Joined: Dec 15, 2008
Posts: 11

the problem is, ex: i have 3 records, then i delete the 2nd record, after that, when i read again i got an error javax.microedition.rms.InvalidRecordIDException, and it's because of the recordID of the 2nd record has been deleted.

i want to know if there's a way to skip reading the 2nd record..

sivakumar arani

Joined: Jul 15, 2007
Posts: 14

you can catch that exception and continue reading next record
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

I'm rusty on that. In a regular SQL query, the way to skip it would either be to do like sivakumar says and handle the exception or to re-issue the query, which would cause a new resultset (minus the deleted record) to be built.

In RMS, there's a deleted record flag, so you might be able to check that and avoid actually throwing an exception. Like I said, I'm rusty on RMS, so I don't know if that's possible. But you can definitely use exception trapping to get beyond it.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: problem with read records in RMS after delete
It's not a secret anymore!