开发者

Accesing already created Sqlite database through phonegap

开发者 https://www.devze.com 2023-04-12 01:54 出处:网络
I have just started using phonegap, and my application demands an use of a database for sto开发者_开发问答rage. Now, i have read all the documentation for phone-gap\'s storage, but nowhere is it given

I have just started using phonegap, and my application demands an use of a database for sto开发者_开发问答rage. Now, i have read all the documentation for phone-gap's storage, but nowhere is it given that one can access an already present database. My question is that can one use an already created database through phonegap? if so then how to do it? where and how to include the database file and how to retrieve values?


Not easily.

There are some seemingly hackish ways to do it, but I have nto tested them. I will post links below.

I am in the same boat. Here is what I am planning (I have done this before with AIR applications for different reasons, I will be doing it with my next PhoneGap app).

Using a tool like SQLite Studio I will take the pre-existing DB and export it (data and all) to a create script. Then I will use that create script to create and load the DB and tables the first time the app runs. Unless you are dealign with a huge amount of data I think this would work in most cases.

References for the hacky solutions:

http://groups.google.com/group/phonegap/browse_thread/thread/ca6c85f7d6c3976c/1195990551444915 http://groups.google.com/group/phonegap/browse_thread/thread/5e57a728dc66a2a1

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号