12-13-2011 01:35 PM
I am working with an SQLite database. However, I am getting intermittent behaviour from my app within the simulator. I suspect it is because while developing I have to hard exit the simulator and am leaving the database in an unknown state.
How can I clear/delete the old database so that I know I am starting the app from a known state? I have tried using clean.bat, but I haven't had any success with it yet.
Solved! Go to Solution.
12-13-2011 02:19 PM
Are you sure that will work for a WebWorks app? I seem to recall that is from Java, but I don't think there is a file path for the WebWorks SQLite database.
12-13-2011 02:58 PM - edited 12-13-2011 03:00 PM
You are simulating an SD card to use the WebSQL I assume, so you can locate the DB files here:
appName may be base64(appName) if you're using OS5. Delete the whole folder manually using Windows explorer.
From within the app, "DROP TABLE.." will remove it, but doesn't help if you can't open because it was corrupted. Here you can use blackberry.io.dir.exists() to make sure the directory actually exists, then use blackberry.io.dir.deleteDirectory([path]) where path == file:///SDCard/BlackBerry/System...
12-13-2011 03:38 PM
Under ...\Blackberry\system\ I only see a media folder. There is no appdata folder.
12-19-2011 02:30 PM
I'm simulating on 9810, and I don't see a /store folder anywhere in my SD image folder.
12-23-2011 04:21 PM
Correction: clean.bat does delete the database from the simulator. However, this doesn't work for an actual device.
Any way to clear/delete an old version of the database from a device (smartphone)?
01-09-2012 11:59 AM
I'm finding now that clean.bat doesn't seem to totally clear the old database. Any way to totally delete the old database, either on the simulator or on the device?
01-09-2012 01:08 PM
My apologies - shnuffy had it right the first time. I have now found the directory where the database is stored. As shnuffy said: Device/Blackberry/system/appdata/rim/webstorage/..