Cant delete a recordstore

Hi,
I was wondering if their is anybody that can tell me why a record store that I have created cannot be deleted using the "RecordStore.deleteRecordStore( );" method.
I have written a bit of code which when executed should delete the entire record store "PLAYERSTORE", but for some reason it does not.
My code:
public void deleteRecordStore()
          try
               System.out.println("Store deleted");
               RecordStore.deleteRecordStore( "PLAYERSTORE" );
          catch( RecordStoreNotFoundException e )
               System.out.println("Exception: "+e);
          catch( RecordStoreException e )
               System.out.println("Exception: "+e);
At first i thought it might be because i hadnt closed the record store after using it in previous methods, unfortunatelly this was not the case.
Please help

Still no joy with deleting the record
I think this is what you are looking for (StackTrace)...
java.lang.NullPointerException
     at CourseListing.deleteRecord(+35)
     at CourseListing.commandAction(+49)
     at javax.microedition.lcdui.Display$DisplayAccessor.commandAction(+282)
     at javax.microedition.lcdui.Display$DisplayManagerImpl.commandAction(+10)
     at com.sun.midp.lcdui.DefaultEventHandler.commandEvent(+68)
     at com.sun.midp.lcdui.AutomatedEventHandler.commandEvent(+47)
     at com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.run(+250)
This is what is displayed when I try and delete a record
I have posted the whole code listing bellow the "bold" code is the code that deletes a record
import javax.microedition.midlet.MIDlet;
import javax.microedition.lcdui.*;
import java.util.*;
import javax.microedition.rms.*;
public class CourseListing extends List implements CommandListener
     private RecordStore rs;
     private GSAP midlet;
     private Command backCommand = new Command("Back", Command.BACK, 0);
     private Command deleteCommand = new Command("Delete", Command.SCREEN, 1);
     private Command viewCommand = new Command("View", Command.SCREEN, 1);
     private Ticker courseListing = new Ticker("The following is a list of courses stored by the GSAP. You have the option of, viewing course details, editing course details, or deleting a course entirely.");
     public CourseListing(GSAP midlet)
          super("COURSES", Choice.EXCLUSIVE);
          this.midlet = midlet;
          addCommand(backCommand);
          addCommand(deleteCommand);
          addCommand(viewCommand);
          setTicker(courseListing);
          setCommandListener(this);
          readRecords();
     public void readRecords()
          //Open COURSESTORE record store
          RecordStore rs = null;
          try
               rs = RecordStore.openRecordStore("COURSESTORE", true);
               System.out.println("COURSESTORE open");
          catch(RecordStoreNotFoundException rsnfe)
               System.out.println("The record store you are trying to open does not exist :"+rsnfe);
          catch(RecordStoreFullException fsfe)
               System.out.println("The record store cannot store anymore data :"+fsfe);
          catch(RecordStoreException rse)
               System.out.println("An error has occured when using the record store :"+rse);
          //Read records from the PLAYERSTORE and store in an array
          try
               byte[] recData = new byte[5];
               int records;
               System.out.println("At the for loop");
               for (int i = 1; i <= rs.getNumRecords(); i++)
                    System.out.println("Inside for loop");
                    // Allocate more storage if necessary
                    if (rs.getRecordSize(i) > recData.length)
                    recData = new byte[rs.getRecordSize(i)];
                    records = rs.getRecord(i, recData, 0);
                    //System.out.println(rs.getRecord(i, recData, 0));
                    System.out.println("Record ID#" + i + ": " + new String(recData, 0, records));
                    //append("Record ID#" + i + ": " + new String(recData, 0, records), null);
                    append(""+ new String(recData, 0, records), null);     
          catch (Exception e)
               System.err.println(e.toString());
          //Close the record store
          try
               rs.closeRecordStore();
          catch( RecordStoreNotOpenException e )
               System.out.println("Record store already closed!");
          catch( RecordStoreException e )
               System.out.println("Exception:"+e);
     public void commandAction(Command c, Displayable d)
          if(c == backCommand)
               midlet.courseMenuScreenShow();
          else if(c == viewCommand)
               System.out.println("View the selected course details");
          else if(c == deleteCommand)
               deleteRecord();
               System.out.println("The selected course will be deleted");
          else
               processMenu();
     private void processMenu()
          try
               List down = (List)midlet.display.getCurrent();
               switch(down.getSelectedIndex())
                    case 0: midlet.addCourseScreenShow();
                    case 1: System.out.println("Manage courses");
          catch(Exception ex)
               System.out.println("processMenu::"+ex);
     public void deleteRecord()
          try
               int id = 1;
               System.out.println("WE ARE HERE NOW");
               rs.openRecordStore( "PLAYERSTORE", true );
               System.out.println("WE ARE HERE NOW FOR GOODNESS SAKE");
               rs.deleteRecord(id);
               System.out.println("WE ARE HERE NOW FOR GOODNESS SAKE OHHH YEAH");
          catch(RecordStoreNotOpenException e)
               System.out.println("Exception: "+e);
          catch(InvalidRecordIDException e)
               System.out.println("Exception: "+e);
          catch( RecordStoreException e )
               System.out.println("Exception:"+e);
               e.printStackTrace();
          //Close the record store
          try
               rs.closeRecordStore();
          catch( RecordStoreNotOpenException e )
               System.out.println("Record store already closed!");
          catch( RecordStoreException e )
               System.out.println("Exception:"+e);
     }//End of deleteRecord() method     
}

Similar Messages

  • Cant delete email from email folder

    I got an email in my inbox with a tick by it that i cant delete its also saved in my saved messages folder and i cant delete it fromn there either its so annoying can anyone help PLEASEEEEEEEEEEEE

    lindafromgainesville wrote:
    ...is there a seperate trash for email?
    In Mail, yes -

  • HT1923 When attempting a reinstall of iTunes, I cant delete the file C\Program Files\Common Files\Apple\Internet Services\Shellstream.resources due to same error message as described above for iPod file; however i can't find it anywhere in the Task Manage

    When attempting a reinstall of iTunes, I cant delete the file C\Program Files\Common Files\Apple\Internet Services\Shellstream.resources due to same error message as described above for iPod file; however i can't find it anywhere in the Task Manager

    That one's consistent with disk/file damage. The first thing I'd try with that is running a disk check (chkdsk) over your C drive.
    XP instructions in the following document: How to perform disk error checking in Windows XP
    Vista instructions in the following document: Check your hard disk for errors
    Windows 7 instructions in the following document: How to use CHKDSK (Check Disk)
    Select both Automatically fix file system errors and Scan for and attempt recovery of bad sectors, or use chkdsk /r (depending on which way you decide to go about doing this). You'll almost certainly have to schedule the chkdsk to run on startup. The scan should take quite a while ... if it quits after a few minutes or seconds, something's interfering with the scan.
    Does the chkdsk find/repair any damage? If so, can you get an install to go through properly afterwards?

  • DOES ANYONE KNOW HOW I CANT DELETE MY APPLE ID I JUST GOT A NEW AND NO LONGER NEED THE OLD 1 HELP PLEASE

    DOES ANYONE KNOW HOW I CANT DELETE MY APPLE ID I JUST GOT A NEW AND NO LONGER NEED THE OLD 1 HELP PLEASE

    As far as I know they can't be deleted, just remove any personal info from it (credit card details etc) and stop using it.
    If you downloaded any content via it then you will need to remember it and it's password, as content is tied to the account that bought/downloaded it, so if you move to a new computer you'll need to authorise the account on it if you want to use any of its content there (or if you bought apps with it you'll only be able to download updates to them via that account)

  • Cant delete apple files or update to newest itunes version windows 7 64 bit

    cant delete apple files or upgrade to new itunes version

    What error messages are you getting during the update attempts, candace? (Precise text, please.)

  • I drop my phone so i got a new one and back up everything... well now i have pics on my phone that i dont want and i cant delete them please help i tired hooking up to iTunes but still cant delete certain ones

    i drop my phone so i got a new one and back up everything... well now i have pics on my phone that i dont want and i cant delete them please help i tired hooking up to iTunes but still cant delete certain ones.... i can send them or post but nothing to delete them

    The pictures that are on your phone, that you don't want, did they appear there after syncing with iTunes? Or were they taken with the iphone's camera?
    Pictures synced from iTunes have to be removed by syncing again, but not having those pictures checked under the Photos tab in iTunes.

  • Well, i was on my laptop now and all of a sudden a pop up message appeared and said "your download is complete" so i went to go check it out and it was 'MacProtector'. i cant delete it and it keeps opening unwanted web pages, please help me sort this out?

    Well, i was on my laptop now and all of a sudden a pop up message appeared and said "your download is complete" so i went to go check it out and it was 'MacProtector'. i cant delete it and it keeps opening unwanted web pages, please help me sort this out someone?

    Refer to:  http://cantalktech.com/2011/05/08/mac-protector/.

  • I cant delet all the itunes files o my cp to download the

    I cant delet all the bonjur files to download the new. Itunes what do i do

    Sync is only oneway, from PC to your device.  Unless you have the music on your PC, iTunes is going to wipe out what you have on your device if you are syncing to a new library.
    You can only transfer Purchased music over to Itunes on your PC.
    iTunes Store: Transferring purchases from your iOS device or iPod to a computer
    http://support.apple.com/kb/HT1848
    As for you own music, you may have to use a third party software.  A good Free one is called Sharepod which you can download from Download.com here:
    http://download.cnet.com/SharePod/3000-2141_4-10794489.html?tag=mncol;2

  • I cant delete anything in my itunes as it just crashes

    since having itunes match , which im going to let lapse as its pretty useless and constantly loses its info and restores itself!  I cant delete any songs or movies without it crashing, i cant even turn it off.
    why is it the more apple add the less it works!!!!

    Hello,
    Please open Firefox in Safe Mode and test to see if the the problem still occurs.
    See here: [[Troubleshoot Firefox issues using Safe Mode]]
    If the issue doesn't occur in Safe Mode then there is a good chance that an Addon or setting is causing the problem. Follow the instructions in the support article above to identify the add-on causing the issue and then disable or remove it.
    If the problem still occurs even when opening in safe mode then I suggest doing a Firefox Reset. Again this can be done by holding shift as you open Firefox (select 'Reset' from the options this time).
    A reset will return Firefox to its default settings. Your history and bookmarks will be saved but you will need to reinstall your add-ons.
    [[Reset Firefox – easily fix most problems]]
    I hope that helps.

  • Cant Delete Jar in Apache Jserv? Why???

    Hi all
    Can any one tell me why i cant delete my jar file in Apache Jserv, servlets folder. It says access denied. I stopped apache server and then tried to delete it. But no use. Help me in this matter.
    One more problem i am getting is my jar file is not able to access the dependent class files like oreilly's Multipart request class. In wrapper classpath i had given oreilly's package path, and my jar is also included in wrapper class path.
    The above jar file i was talking is created by me.
    Expecting your help soon.....
    Thanks and Regards
    Ramesh.

    Hi Ramesh,
    If you're unable to move or delete .jar, .log, .conf, or any other files after stopping Apache, the JVM has not been properly stopped. When you start Apache with Apache JServ configured, a separate JVM (java.exe) process is started. Many Win32 users use Ctrl-C to stop Apache, and this does not stop the JVM. Also, occassionally with buggy code or buggy VMs, the Java process will not respond to Apache's requests to shutdown.
    The preferred way of stopping the JVM properly is to use the command line options to shutdown Apache. In NT, you can type "net stop apache", and on all Win32, you can type "apache -k shutdown", from a command prompt. This should properly shutdown the JVM.
    If the JVM does not die, you will have to manually kill the process. In 95/98, Ctrl-Alt-Del will list the processes; select the process and click "End Process". In NT, start the task manager, select the process, right click, and select end process. If that doesn't stop your JVM, reboot.
    Hope this will help you.
    Regards,
    Anil.
    Technical Support Engineer.

  • SnS-Superuse cant delete video files

    Hello all,
    Is the following behaviour acceptable?
    The default SnS superuser account cant delete other user's uploaded video files!!!
    Instead, the video file must be deleted by the same user!
    How do you tackle with this?
    Thank you

    I agree that it would be great if the superuser could delete any video file and I think it should be an option, but I have found that only the user that uploaded the file can delete it.

  • I CANT delete itunes 4.01 AT ALL or install Itunes 7.0!

    Ok, i got a new nano.
    I need Itunes 7.01.......When I downloaded it, everything went fine.
    but then, during the installation process, when it says "validating installation" it stops and a scree comes up and says
    "itunes setup complete, itunes encountered errors before configuring itunes, please try later"
    IT always says that!
    Secondly, I cant delete my old itunes AT ALL....I click on remove in control panel and NOTHING happens.
    Also, I cannot open my old versions of itunes at all now.......what do I do, Im stuck.
    If you need anymore info to understand my problem, please tell me, I dont wanna take my Nano back all because of iTunes.

    Try to remove all Apple related software and then reinstall iTunes Removing iTunes, QuickTime, and other software components for Windows Vista

  • HT1386 When i first synced my iphone it synced around 3000 photo's.  It now wont ley me sync my phone at all as i need the new ios version but because of the photo's i dont have enough space but i cant delete the photo's because my phone wont sync. HELP P

    When i first synced my iphone it synced around 3000 photo's.  It now wont ley me sync my phone at all as i need the new ios version but because of the photo's i dont have enough space but i cant delete the photo's because my phone wont sync. HELP PLEASE!!

    Use iPhone as designed. Like any digital camera, download your photos to your computer and delete from the iPhone to create space required for iOS upgrade.

  • Hello, i changed my mediathek-folder due to space-problems and since then i am not able to fill the iphone (4) with music anymore. also i cant delete music in itunes, which already is on the iphone... HELP!!!

    hello, i changed my mediathek-folder due to space-problems and since then i am not able to fill the iphone (4) with music anymore. also i cant delete music in itunes, which already is on the iphone... HELP!
    does anybody know how to solve this problem? thx!

    If you want to try to clear even more disk space see https://discussions.apple.com/thread/5872318?tstart=0

  • Cant delete ibooks bookmarks , says "no title" and a date, happened when I updated to

    Cant delete ibooks bookmarks , says "no title" and a date, happened when I updated to iOS 8.1.2, help driving me crazy!

    Using iTunes on your computer, open Preferences (under the leftmost item in iTunes menu).  Choose "Devices" on top.  Find your backup listed there, highlight it, and select "Delete Backup".

Maybe you are looking for