Updating a particular record involves getting a handle for that record and setting new information.
public int getRecord(int recordId, byte[] buffer, int offset) returns the data stored in the given record in the byte array represented by buffer. public byte[] getRecord(int recorded) returns a copy of the data represented by recordId. public void setRecord(int recordId, byte[] newData, int offset, int numBytes) 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.
Listing 5. Update a record
String newappt = "update record";
Byte data = newappt.getBytes();
Rs.setRecord(1, data, 0, data.length());
Deleting records
The MIDlet invokes the deleteRecord() method to delete a record from the record store.
public void deleteRecord(int recordId) deletes the record represented by recordId. The recordId for this record is not subsequently reused.
Rs.deleteRecord(1);