已经通过phonegap创建了Sqlite数据库 [英] Accesing already created Sqlite database through phonegap

查看:116
本文介绍了已经通过phonegap创建了Sqlite数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用phonegap,我的应用程序需要使用数据库进行存储。现在,我已经阅读了phone-gap的存储的所有文档,但没有给出一个可以访问已经存在的数据库。
我的问题是,可以通过phonegap使用已经创建的数据库吗?如果是那么怎么办呢?在哪里和如何包括数据库文件和如何检索值?

I have just started using phonegap, and my application demands an use of a database for storage. 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?

推荐答案

有一些看似简单的方法来做,但我没有测试他们。我将在下面发布链接。

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

我在同一艘船上。这里是我计划(我已经做了这个AIR应用程序的不同原因,我会做它与我的下一个PhoneGap应用程序)。

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).

使用SQLite Studio之类的工具我将使用现有的数据库并将其(数据和所有)导出到创建脚本。然后,我将使用该创建脚本创建和加载数据库和表第一次运行应用程序。除非你是与大量的数据,我认为这将工作在大多数情况下。

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.

hacky解决方案的参考资料:

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

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

这篇关于已经通过phonegap创建了Sqlite数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆