gpt4 book ai didi

android - 从 phonegap 中的 Assets 访问 sqlite 数据库

转载 作者:行者123 更新时间:2023-11-29 01:35:09 25 4
gpt4 key购买 nike

我有一个关于 phonegap 和 sqlite 数据库的问题。我在我的 Assets 文件夹“myDB.db”中预填充了数据库,我的问题是我想直接从 Assets 文件夹访问数据库到 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});

如需更多引用,请按照以下链接中的步骤操作...

http://santoshshinde2012.blogspot.in/2015/03/open-existing-sqlite-file-in-phonegap.html

希望对您有所帮助。

关于android - 从 phonegap 中的 Assets 访问 sqlite 数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28716102/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com