Codenameone: access sqlite outside application dir/database

左心房为你撑大大i 提交于 2019-12-11 14:06:43

问题


How can i Access a SQLite DB which exists outside the application/database dir?

Looks like openOrCreate alway point to the appdir/database


回答1:


You can only use getDatabasePath to get the path for the DB and assuming it is not null copy the file into the given location. The reasoning is that database might not be SQLite so it won't necessarily consist of one file. There is also the issue of filesystem which isn't very portable between platforms.



来源:https://stackoverflow.com/questions/15140469/codenameone-access-sqlite-outside-application-dir-database

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!