Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
Posts: 22
Registered: ‎05-04-2012
My Device: BlackBerry Torch 9800
My Carrier: MTN Nigeria
Accepted Solution

Unable to Connect to SQLite Database in 9700

Hi all, I created an app dt dynamically retrieves data from a locally stored Sqlite database the strange thing is that this app functions properly on my 9800 and a friend's 9930 but whenever use this app on 9700 it is unable to connect to the database. Here's the code i use to connect to the database(same code was compiled and tested on all 3 devices):

//Connect to database
try {
URI myURI = URI.create("/store/home/user/documents/database.db");
Db = DatabaseFactory.openOrCreate(myURI);
} Catch (Exception e) { }
If (db == null) {
Dialog.alert("Unable to Access Database");
}


Is there something about the 9700 device that I'm not aware of? Because this code works on other devices... Help please.
Developer
Posts: 434
Registered: ‎07-23-2012
My Device: Blackberry 10
My Carrier: Orange

Re: Unable to Connect to SQLite Database in 9700

check with these links

 

http://www.blackberry.com/developers/docs/5.0.0api/data_storage-summary.html

 

http://supportforums.blackberry.com/t5/Java-Development/Exception-thrown-in-sqlite-when-i-try-to-do-...

 

and SQl Demo of the blackberry sample

 

Thanks
-------------------------------------------------------------------------------------
Press the Accept as solution Button when u got the Solution
Press Kudo to say thank to developer.
-------------------------------------------------------------------------------------.
Developer
Posts: 434
Registered: ‎07-23-2012
My Device: Blackberry 10
My Carrier: Orange

Re: Unable to Connect to SQLite Database in 9700

One more thing you must be getting some error. Share error details 

Thanks
-------------------------------------------------------------------------------------
Press the Accept as solution Button when u got the Solution
Press Kudo to say thank to developer.
-------------------------------------------------------------------------------------.
Contributor
Posts: 22
Registered: ‎05-04-2012
My Device: BlackBerry Torch 9800
My Carrier: MTN Nigeria

Re: Unable to Connect to SQLite Database in 9700

That's the funny thing, its not giving any error... Besides the app works properly on my 9800 while on the 9700, it keeps saying "unable to access database"; the customised message i set to alert me in case the app was unable to connect to the db.
Ps: the db is placed in the correct path.
Developer
Posts: 434
Registered: ‎07-23-2012
My Device: Blackberry 10
My Carrier: Orange

Re: Unable to Connect to SQLite Database in 9700

Check SDK mount. Try to print stack trace so you can share more details 

Thanks
-------------------------------------------------------------------------------------
Press the Accept as solution Button when u got the Solution
Press Kudo to say thank to developer.
-------------------------------------------------------------------------------------.
Contributor
Posts: 22
Registered: ‎05-04-2012
My Device: BlackBerry Torch 9800
My Carrier: MTN Nigeria

Re: Unable to Connect to SQLite Database in 9700

I finally discovered that it does not give the error if the database is stored on a sdcard maybe 9700 does not support sqlite access on device memory. Thanks for trying