Deleting record in J2ME RMS

Hi All,

The below examples will show how to delete a record in RMS database in Midlet application. There is an API in RecordStore which deletes a record by taking recordId as an input.

public boolean deleteRecord(int recordId){

RecordStore rec=null;
try{
rec=RecordStore.openRecordStore(“notes”, true );
rec.deleteRecord(recordId); // delete a record in Record Store.
return true;

}catch(Excecption ex){
return false;
}finally{
rec.closeRecordStore();

}

}

Thanks

R Vashi.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s