Java Reference
In-Depth Information
The enumerateRecords method can throw a RecordStoreNotOpenException , if you've
closed the record store before invoking it.
Updating a Record
To update a record in the record store, you must have its ID. With its ID in hand, you can
use the record store's setRecord method to set new contents for the record, just as if you
were adding a record. The method takes four arguments:
• The ID of the record to modify
• An array of bytes from which to draw the record
• An offset into the array indicating the first byte of the record
• The number of bytes (counting from the indicated offset) that comprise the record
As with other record manipulations, this method can throw an exception, including
any of the following:
RecordStoreNotOpenException : Indicates that the record store you want to add a
record to isn't open
InvalidRecordIDException : Indicates that the record ID is invalid
RecordStoreFullException : Indicates that the operation cannot be completed
because the record store or its underlying medium is full
RecordStoreException : Indicates a general failure related to the open record store
SecurityException : Indicates that the MIDlet is not authorized to write to the
record store.
Removing a Record
To remove a record from the record store, simply call deleteRecord , passing the record ID
of the record to be deleted. This method throws one of the following exceptions if an
error occurs:
RecordStoreNotOpenException : Indicates that the record store you want to add a
record to isn't open
InvalidRecordIDException : Indicates that the record ID is invalid
 
Search WWH ::




Custom Search