Codenameone:在应用程序目录/数据库外部访问sqlite [英] Codenameone: access sqlite outside application dir/database

查看:57
本文介绍了Codenameone:在应用程序目录/数据库外部访问sqlite的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何访问应用程序/数据库目录之外的SQLite数据库?

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

看起来像 openOrCreate 始终指向appdir /数据库

Looks like openOrCreate alway point to the appdir/database

推荐答案

您只能使用 getDatabasePath 要获取数据库的路径,并假设它不为null,请将文件复制到给定位置。原因是数据库可能不是SQLite,因此它不一定包含一个文件。还有文件系统的问题,它们在平台之间不是很容易移植。

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.

这篇关于Codenameone:在应用程序目录/数据库外部访问sqlite的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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