从 phonegap 中的资产访问 sqlite 数据库
Access sqlite database from assets in phonegap
我有一个关于使用 sqlite 的 phonegap 的问题 database.I 在我的资产文件夹中预填充了数据库 "myDB.db" 我的问题是我想直接从资产文件夹访问数据库到 phonegap。我不想复制到 SD 卡或不使用外部数据库。
问候
请在您的代码中试试这个
//Please place your db file in wwww directory ,here example : projectpath/www/santosh.db
db = window.sqlitePlugin.openDatabase({name: "santosh.db", createFromLocation: 1});
如需更多参考,请按照以下 link...
中的步骤操作
http://santoshshinde2012.blogspot.in/2015/03/open-existing-sqlite-file-in-phonegap.html
希望对您有所帮助。
我有一个关于使用 sqlite 的 phonegap 的问题 database.I 在我的资产文件夹中预填充了数据库 "myDB.db" 我的问题是我想直接从资产文件夹访问数据库到 phonegap。我不想复制到 SD 卡或不使用外部数据库。 问候
请在您的代码中试试这个
//Please place your db file in wwww directory ,here example : projectpath/www/santosh.db
db = window.sqlitePlugin.openDatabase({name: "santosh.db", createFromLocation: 1});
如需更多参考,请按照以下 link...
中的步骤操作http://santoshshinde2012.blogspot.in/2015/03/open-existing-sqlite-file-in-phonegap.html
希望对您有所帮助。