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
rabiyabasri
Posts: 49
Registered: ‎12-21-2010
My Device: 9000 Bold Device
My Carrier: software developer

Sqlite issue

hi,

 

i have one small issue related to sqlite database. i am creating one sample example for sqlite, i am getting database was not created.Invalid path name. Path does not contains a proper root list. See FileSystemRegistry class for details.i am using 5.0 os and running on 9550 simulator.

 

i tried to search on it but it is telling about sd card.without sd card it wont work.please tell me what is the issue.

 

Thanks

Please use plain text.
Developer
ankityadav4u
Posts: 231
Registered: ‎03-16-2011
My Device: 9700, 9550, and JDE
My Carrier: AIRTEL, BSNL

Re: Sqlite issue

can u give the code here???


available on: Monday to Friday, Indian standard (day) time : )
  • Give kudos by clicking on the star icon to say "Thanks!" if you feel this response is helpful.
  • Click "Accept as Solution" if this post was what you needed. so that people who are trying to help will not waste their time reading a thread where no help is needed.

Please use plain text.
Contributor
rabiyabasri
Posts: 49
Registered: ‎12-21-2010
My Device: 9000 Bold Device
My Carrier: software developer

Re: Sqlite issue

Please use plain text.
Developer
ankityadav4u
Posts: 231
Registered: ‎03-16-2011
My Device: 9700, 9550, and JDE
My Carrier: AIRTEL, BSNL

Re: Sqlite issue

[ Edited ]

try to configure SDCard for your simulator, or use phone memory as is:::

"file:///store/Databases/database1.db"

available on: Monday to Friday, Indian standard (day) time : )
  • Give kudos by clicking on the star icon to say "Thanks!" if you feel this response is helpful.
  • Click "Accept as Solution" if this post was what you needed. so that people who are trying to help will not waste their time reading a thread where no help is needed.

Please use plain text.
Contributor
rabiyabasri
Posts: 49
Registered: ‎12-21-2010
My Device: 9000 Bold Device
My Carrier: software developer

Re: Sqlite issue

hi,

 

Thanks a lot for replying.

1. Any one please tell me how to configure SDCard in my simulator.

2. Now I can able to create database using sqlite, but i can not able to insert data into a table,

   its displaying error as file system error(12)

please tell me how to fix this error.

 

Thanks

Please use plain text.
Developer
ankityadav4u
Posts: 231
Registered: ‎03-16-2011
My Device: 9700, 9550, and JDE
My Carrier: AIRTEL, BSNL

Re: Sqlite issue

just create a file with the extension '-sdcard.dmp' (include starting hyphen'-' also)

in simulator go to simulate, change SD card then  browse for the file u created

 

 

ur other problem is after 1st execution, bcz it already created db, if u again execute it, it can not create file again, thats y throwing filesystem exception.


available on: Monday to Friday, Indian standard (day) time : )
  • Give kudos by clicking on the star icon to say "Thanks!" if you feel this response is helpful.
  • Click "Accept as Solution" if this post was what you needed. so that people who are trying to help will not waste their time reading a thread where no help is needed.

Please use plain text.
Contributor
rabiyabasri
Posts: 49
Registered: ‎12-21-2010
My Device: 9000 Bold Device
My Carrier: software developer

Re: Sqlite issue

hi,

 

please tell me what i have to do if throws filesystem error.

 

Thanks

Please use plain text.
Developer
ankityadav4u
Posts: 231
Registered: ‎03-16-2011
My Device: 9700, 9550, and JDE
My Carrier: AIRTEL, BSNL

Re: Sqlite issue

instead of using DatabaseFactory.create(), use DatabaseFactory.openOrCreate()


available on: Monday to Friday, Indian standard (day) time : )
  • Give kudos by clicking on the star icon to say "Thanks!" if you feel this response is helpful.
  • Click "Accept as Solution" if this post was what you needed. so that people who are trying to help will not waste their time reading a thread where no help is needed.

Please use plain text.
Contributor
rabiyabasri
Posts: 49
Registered: ‎12-21-2010
My Device: 9000 Bold Device
My Carrier: software developer

Re: Sqlite issue

hi,

 

I can able to create database using sqlite, but i can not able to insert data into a table,

   its displaying error as file system error(12)

here is my code

URI myURI = URI.create("file:///store/Databases/database.db");
                sqliteDB = DatabaseFactory.open(myURI);

                Statement st = sqliteDB.createStatement("INSERT INTO Employee(Name,Age) " +
                        "VALUES ('Ralph',47)");
                st.prepare();
                st.execute();

please help me how to insert data and how to retrive it.

 

Thanks

Please use plain text.
Developer
ankityadav4u
Posts: 231
Registered: ‎03-16-2011
My Device: 9700, 9550, and JDE
My Carrier: AIRTEL, BSNL

Re: Sqlite issue

here is no problem in the code, can u write here whole class, this code belongs to??


available on: Monday to Friday, Indian standard (day) time : )
  • Give kudos by clicking on the star icon to say "Thanks!" if you feel this response is helpful.
  • Click "Accept as Solution" if this post was what you needed. so that people who are trying to help will not waste their time reading a thread where no help is needed.

Please use plain text.