Can not copy the database of res folder and write to the memory card

I developed a small application using blackberry jde 7.0. I want to copy the database (.db) of res folder and write to the memory card. When I run in the Simulator, it throws exception "FileNotFound". But the file is located in the res folder.

Help me guys...

Here is the code

 copyFile("/Demo.db","file:///SDCard/Databases/Demo.db");
//Copy to Memory card
public void copyFile(String srFile, String dtFile)
{
try
{
FileConnection fconn;
fconn = (FileConnection) Connector.open(dtFile,Connector.READ_WRITE);
//if(!fconn.exists()) // if file does not exists , create a new one
// {
// fconn.create();
// }
InputStream is = (InputStream)getClass().getResourceAsStream(srFile);
System.out.println("read" + String.valueOf(is.available()));
OutputStream os =fconn.openOutputStream();
byte[] buf = new byte[is.available()];
int len;
while ((len = is.read(buf)) > 0)
{
os.write(buf, 0, len);
}
is.close();
os.close();
}
catch(IOException e)
{
System.out.println("Exception"+e.getMessage());
}
}

The exception is

File not found

«When I run in the Simulator he throws exception "FileNotFound".»

Which line is the rise of this?

You might find the code in the sample application SQLiteDemo, which does almost the same thing, useful in the study to determine what went wrong.

Tags: BlackBerry Developers

Similar Questions

  • Can not format the memory card

    Canon that PowerShot SX 10 IS reformatted not 16 GB SanDisk Ultra.  Camera says memory card error.  Everything else seems to work on the camera.  Is there a way to fix this?

    Your camera specifications say that it will work with the following cards, memory card SD/SDHC, MultiMediaCard, MMC Plus card, HC MMC Plus card.

    Some memory cards note their speeds by a "class." Canon cameras are recommended to be used with nominal class cards 4 to SD (Standard-definition movies) and class 6 for HD (high definition movies) or more because of the large amount of data written to the card. As long as map meets the following standards for the card, the memory card must be compatible regardless of class or the speed rating.

    SD

    Standard Secure Digital card supports up to 2 GB capacity.

    SDHC

    Secure Digital High Capacity currently supports up to 32 GB capacity.

    MMC

    Multimedia card supports up to 1 GB capacities.

    MMCPlus

    MultiMediaCardPlus supports up to 4 GB currently.

    HC MMCPlus

    High capacity MultiMediaCardPlus supports up to 8 GB now.

  • An SD card is inserted, but my laptop Packard Bell does not recognize the memory card.

    Original title: peripheral equipment

    An SD card is inserted, but the PC (my laptop is a Packard bell) has no reaction. It does not recognize the memory card.

    Thanks for your help.
    Christine.

    Hi Stefano,

    Thanks for posting your question in the Microsoft Community.

    This problem can be caused if the SD card is damaged or the card reader may not work properly.

    1. What is the brand and model of the SD memory card?

    2. What is the number of the model of the Packard Bell laptop?

    3. you receive an error code or the message after inserting the SD card into your laptop?

    4. have you made any recent hardware or exchange of software on your computer before the show?

    5. have you tried to insert different SD card in your laptop?

    6. have you checked the SD card in another computer?

    7. you try to connect the SD card to a built-in card reader or externally by USB port card reader?

    8. is the specific question to a SD card or any type of cards?

    9. are you able to detect the SD card in the Device Manager?

     

    Open the Device Manager:

    http://Windows.Microsoft.com/en-in/Windows7/open-Device-Manager

    If your computer is having problems with a recently installed device or other hardware, try to use the hardware and peripheral troubleshooting tool to solve the problem. It checks the common issues of interest and ensures that a new device or hardware connected to your computer has been installed correctly.

    Open the hardware and devices Troubleshooter:

    http://Windows.Microsoft.com/en-us/Windows7/open-the-hardware-and-devices-Troubleshooter

     

    For reference:

     

    Updated a hardware driver that is not working properly:

    http://Windows.Microsoft.com/en-us/Windows/Update-driver-hardware-ISN

    Let us know the status of the issue. If you need help, please after return. We will be happy to help you.

  • How can I unlock the memory card?

    How can I unlock the memory card?

    Dawn WInans

    Thank you very much. So happy you showed a picture on how to unlock the memory card. I've tried it & it worked. The photo has really helped. I found the protecter in the camera slider tab & not on the actual memory card. But thanks to your very detailed picture, I got it

  • Moto Q does not recognize the memory card

    I just added a 2 GB memory card that is approved for the Moto Q 9 M... For some reason, my phone does not recognize the memory card. In the memory section it shows the card is unknown.

    With a previous discussion, I saw, I did add the memory card on my PC. It does not recognize the card... Any ideas?

    Thank you

    Jason

    Try formatting the card on your pc and then install it on the phone. If it's 2 GB sandisk it should work fine. If the phone or the card is left. Sometimes reformat card strives to set everything right.

  • Software JetDirect 380 X can not see the airport card in the laptop G4 PPC

    Hello

    I tried to add a customer to the airport. It's a LaserJet 1200. But the software that comes with the JetDirect tells me to install an Airport card in the laptop. Now I can join hpsetup and print to the LJ 1200. But in practice I have to disconnect from the internet and the map Airport.  So, I know the JetDirect and LaserJet 1200 work very well. I tried different settings on the airport, but nothing has really changed the software on the laptop not finding the Airport card.

    Now I have a WOW goes a Xsense MIH 130 Xrouter, then go to the Airport Express Terminal. All Mac desk top of page 933mh, 1.67 ghz powerbooks. I use OSX10.4 to 10.5.8.  I don't know if the router is the problem or if the parameter in the jetdirect should be changed to the ad-hoc to something else. Don't know how to do this. With it, do not see the map Airport, I can't do the enbedded 192.0.0.192. There are a lot of maybe if I do this or if I do this it might work. Since the configuration of the printer in the TCP/IP section page everything below the line, Config by: is not specified.

    Thanks for any advice.

    Well again I was able to get to the stage 1.6 (in 10.5.8 printing Center is not the same). I could remove the printer that was working on its own network of HP. But was unable to add a printer in 0SX 10.5. Perhaps through IP printing, but do I put as the address? It is the site of HP to get instructions on a 380 X and another printer.

    http://h20000.www2.HP.com/bizsupport/TechSupport/document.jsp?lang=en & CC = US & TaskID = 115 & prodSeriesId = 29789 & prodTypeId = 18972 & prodSeriesId = 29789 & objectid = c00257796

    Maybe I should to the left of the printer, but I've changed the SSID in the jetdirect to match the network. The IP printer 192.0.0.192 or 192.0.0.193 or just use the network name it was changed to?

    To close, but I thought a few times.

  • PC can not recognize the wireless card

    Hello. I have a Presario CQ60-205EZ running vista home basic 32. I had virus problems and had to format and reinstall vista. I used vista (Home premium 32) friend dvd with my product key. Everything is fine, but now, the computer does not recognize the wireless card. It does not list in the Device Manager (I think it's in the other devices section) and I tried to download some drivers from the hp site and apply them here but they do not work. I even tried to go into the bios, but I found no option to deal with it. I suspect that miss me a pilot but which and how to apply it? Can anyone help please? Thank you!

    It works!

    Thank you very much, this forum is great!

    Best regards

    Jorge

  • COMPUTER DOES NOT RECOGNIZE THE MEMORY CARD

    WHEN I INSERT THE MEMORY CARD INTO THE COMPUTER NOTHING NOT SE PAST AND IT DOES NOT APPEAR IN MY COMPUTER SO I NEED TO KNOW IF ITS A SETTING OR A DRIVER OR IF ITS THE SLOT IN HIS CAR?

    WHEN I INSERT THE MEMORY CARD INTO THE COMPUTER NOTHING NOT SE PAST AND IT DOES NOT APPEAR IN MY COMPUTER SO I NEED TO KNOW IF ITS A SETTING OR A DRIVER OR IF ITS THE SLOT IN HIS CAR?

    ============================
    This card worked previously on this system?

    Certainly could be hardware related... other
    cards work on your system? This card works
    on other systems?

    Perhaps the card is not compatible with your system.
    For example, it can be a SDHC memory card.

    Perhaps the following links will enlighten us:

    Availability of the Windows Vista Secure Digital (SD) Rollup package
    http://support.Microsoft.com/kb/936825

    SDHC (Secure Digital High Capacity) memory card FAQ
    http://www.supermediastore.com/SDHC-memory-card-secure-digital-high-capacity-FAQ.html

    Good luck. John Inzer - MS - MVP - digital media experience

  • Palm Centro - Verizon - does not recognize the memory card

    I have the new Palm Centro from Verizon.  Had several problems with the pda and now with the memory card.  I have a Sandisk micro sd 512 MB card.  It works on my old phone and motorcycle in the slot on the computer, but the phone emits no beep when it is inserted and the menu says no 'no card inserted '.  I don't have another card to try right now.  Have I not a bad phone unit?

    Help, please.

    See my response above.

    WyreNut

    Message relates to: Centro (AT & T)

  • Can not copy the content of my Cybershot C901 of SE to my new Elm SE

    I need help.

    I managed to download Media Go on my PC and did a synchronization of the content (especially for media files) to Media Go environment.

    I then cut. At the time wherever I am, my old phone records WILL disappear. And when I connect the USB to my new Elm, I can not of course copy the 'old' files above.

    Its not obvious (to me) what I'm doing wrong.

    Can someone please help? Its my wife's phone and I'm getting an attitude

    Thank you

    Yes try what I said above.

  • Got a new computer and can not copy the catalog on my USB key.

    I have a new Dell laptop and have downloaded Lightroom to my new computer. I tried my backup from my old computer catalog and he said: "the process cannot access the file because another process has locked a portion of the file. I already tried to delete the lrcat.lock file as Adobe said to do and it did not work. I have no idea what to do! Help, please!

    Close LR. Open Windows Explorer (Windows File Manager), or on the link for computer workstation work, Documents, or any other link that will open the Windows File Manager.

    Copy the LR catalog file which is normally located in a subfolder of your user account on the USB drive. Then copy it to your new computer, place it in the same WAY as it comes. You must also copy all your image files or if they are all on a disk external drive connect this external drive to your new computer. If all your images are on your internal drive and then when you copy them on they must also reside in the same WAY that they were on your old computer.

  • Windows XP can not copy the pictures / or on a cd. Why?

    I try to copy the picture and window informs you that windows cannot copy the file!

    Thank you! How to burn pictures on a DVD?

    Try CDBurnerXP. It burns photos and much more, and it's free and secure.

  • Can not remove the memory stick slot on Satellite A series card reader

    I hava inserted a memory sony stick into the slot of the card and can not read or retrieve it from the slot.

    I need to disassemble the machine to remove or is there an easier way?

    Thanks for the brief info;

  • G2 355 J0Y60E #ABV: I can not install the graphics card on my PC

    I can NOT INSTALL GRAPHIC CARD DRIVER ON MY LABTOP I USING WINDOWS 7 PROFESSIONAL x 64 AND I HAVE ALREADY DOWNLOD THE DRIVER for MY COMPUTER PORTABLE IT STILL NOT WORKING AND
    Thank you..

    What is the error message you get when you try to install the driver?

    You have downloaded the correct driver for your graphics card? The correct driver for your laptop is mentioned in the link below:

    http://h10025.www1.HP.com/ewfrf/wc/softwareCategory?OS=4132 & LC = da & CC = DK & DLC = da & sw_lang = & Product = 5353028 #N6506

    Please download the softpaq and try to install this. (In case you can not install this in normal mode, try to start in safe mode (by pressing F10 during during the boot process and select "safe mode") and then check if you can install the driver.)

    You can also download and install the latest version of the BIOS from the following link:

    http://h20564.www2.HP.com/hpsc/SWD/public/detail?sp4ts.Oid=6886537 & swItemId = ob_135192_1 & swEnvOid = 4059

    This should help.

    If you still have problems, please post your error message here.

  • Cannot find the product key and can not use the gift cards to buy Windows 7 from retail store

    Original title: Let Down by Microsoft Retail store

    My daughter lives and breathes on his pc. We had some tough times lately, and of course, his computer has had too many problems. In February of this year, I bought a Win 7 Home Premium for his pc. Since we moved, so I can't find the package with the product key, or the disc. I have $75 in gift cards from Microsoft, I need to buy new win 7 hp. Almost all retailers (in store and online) competitive price a new copy for about $119. We have been saving, and with gift cards, I would have just enough money to buy win 7 hp for my daughter. I went to our Microsoft store in the Mall. (Don't forget I saved for about 6 weeks, we are on a budget, then gift cards have been a miracle!) Guess what? The only place that I can use the maps from Microsoft wants $199.99. To add insult to injury - I can't use gift cards for purchases in line-HELP! We waited 2 months just to be left out... I am very disappointed by Microsoft.
    I thought that we recorded our product with Microsoft when it was originally installed, but cannot find anyone. All solutions?

    If you have purchased windows is installed a keyfinder allows you to recover your product key.

    I think that the price of $119 is to upgrade xp/vista to windows 7.
    the $199 price is for the full version.

Maybe you are looking for