Languages

Menu
Sites
Language
How to load database created in sqlite browser?

I have been created .db file in sqlite browser. Now i want to load its data in my application.
So how to make connection to this .db database??? Will anyone help me?

Edited by: bhoomika rathod on 01 Oct, 2017

Responses

3 Replies
Armaan-Ul- Islam

Hello,

I would suggest "Complete tutorial for sqlite database CRUD operation and data access from Tizen native application" by Mohammad Nur Nobi. Seems pretty good to me.

 

In your case As you want to work with a '.db' file, that is already created, Keep your '.db' file on '/res' directory which is the default directory to keep application resources in Tizen File system. I hope after reading these post & Guide you would understand my hint.

Access to /data folder

File System Directory Hierarchy

 

What you have to do is in opendb() function to open database instance, (Sqlitedbhelper.c file in the guide mentioned):

Replace app_get_data_path() with app_get_resource_path() to get the application resource directory path.

 

Hope this will fix the Issue. In case, If you face difficulties in modifying db while keeping it in 'res' folder, then copy the sqlite database instance to data path from resource path first using C code in your application.

bhoomika rathod

i have data.db in res folder and i want to copy it in shared/data folder at runtime.
first i opened data.db from res and then opened another data2.db in shared/data.
Now i want to copy data.db in data2.db. How to do this ???

Armaan-Ul- Islam

I've shared a code snippet here on this link for copying '.db' file to 'shared/data' folder from 'res' folder at runtime.

https://developer.tizen.org/forums/native-application-development/how-copy-sqlite-data.db-file-application-runtime#comment-25969

 

Please Share your feedback.