Hi, This is Rajesh Presently working on j2me , i am able to insert data in my recordstore and access the data , The problem is that when i am exit the application and again start the same application i am getting
javax.microedition.rms.RecordStoreNotFoundException: This is My Code
public void ReadDetails1() throws RecordStoreFullException, RecordStoreNotFoundException, RecordStoreException
String result = "";
rs = RecordStore.openRecordStore(recordname, false);// I
RecordFilter rf = new averageFilter();
RecordEnumeration re = rs.enumerateRecords(rf, null, false);
System.out.println("before while for fetching records");
System.out.println("IN while loop of Recordstore");
int recordID = re.nextRecordId();
data = rs.getRecord(recordID);
System.out.println("Record Names are::::::::::::"+name);
Are you working with Emulator ?? If please check the properties of your Emulator.
In real device it will work.
Joined: Apr 18, 2011
Thanks for your Reply
yes, presently i am working on emulator.
The Code was working fine, all of sudden this exception javax.microedition.rms.RecordStoreNotFoundException is raised.
My Module of project is based on backend ( retriving the data stored in rms files) , every time insertion of new data may not reach my requirement.
Please Help me What to do furthur
Waiting for your reply.
Joined: Oct 14, 2009
I dont know which Emulator is you using. In Nokia & Samsung Emulator , there is an option for delete RMS before starting Midlet.
I am always working with Nokia & Samsung.Your code will work in real Device.
Joined: Apr 18, 2011
I found the solution
Remove "in.use" file from emulator path which in my computer is:
C:\Documents and Settings\Administrator\j2mewtk\2.5.2\appdb\DefaultColorPhone
Normally this file is absent. But when emulator is launched, this file is created so that if second instance of emulator is launched then it won't use the same folder. And during exit of the emulator, it is deleted. But if emulator is crashed and unable to do cleanup operations then this file sometimes remains. So, when you again launch the emulator, it thinks that this folder is already in use. So it creates a new temporary folder and delete it on exit.