언어 설정

Menu
Sites
Language
Write to SQLite database

Hi,

 

i'm trying to insert data into a SQLite database. SQLite .db file is deployed in shared/res/ folder of the application, but when I try to execute an INSERT sentence, it says: "attempt to write a readonly database".

How can I write to this database?

Thanks.

Responses

3 댓글
Alex Dem

Hi,
This topic: https://developer.tizen.org/forums/native-application-development/unable-access-database-created-trusted-folder & this tutorial : https://developer.tizen.org/development/tutorials/native-application/base/sqlite
maybe could be useful.
Also I am not sure that you are able to open in SQLITE_OPEN_READWRITE mode or create database in this folder.
Alexey.

Jeongsu Kim

shared/res is read only area. you have to use "shared/data"

pius lee

Refer this URL,

For https://developer.tizen.org/dev-guide/2.3.0/org.tizen.native.mobile.apireference/group__CAPI__APP__COMMON__MODULE.html

 

You must use the directory paths from getter functions for compatibilities between devices.

Additionaly, You would be know about can be write or not from API description.

App_get_xxx_data_path is wratable directory, other directory may be read only.

char *  app_get_data_path (void)
  Gets the absolute path to the application's data directory which is used to store private data of the application. 
char *  app_get_cache_path (void)
  Gets the absolute path to the application's cache directory which is used to store temporary data of the application. 
char *  app_get_resource_path (void)
  Gets the absolute path to the application resource directory. The resource files are delivered with the application package. 
char *  app_get_shared_data_path (void)
  Gets the absolute path to the application's shared data directory which is used to share data with other applications. 
char *  app_get_shared_resource_path (void)
  Gets the absolute path to the application's shared resource directory which is used to share resources with other applications. 
char *  app_get_shared_trusted_path (void)
  Gets the absolute path to the application's shared trusted directory which is used to share data with a family of trusted applications. 
char *  app_get_external_data_path (void)
  Gets the absolute path to the application's external data directory which is used to store data of the application. 
char *  app_get_external_cache_path (void)
  Gets the absolute path to the application's external cache directory which is used to store temporary data of the application. 
char *  app_get_external_shared_data_path (void)
  Gets the absolute path to the application's external shared data directory which is used to share data with other applications.