SQLite DB 的 MIDP Java 实现
是否有任何 SQLite db 的 MIDP 实现可用于在 MIDlet 中使用 sqlite db,而不是使用 RMS。 当然还有Floggy和OpenBaseMovil,但是它们基于RMS,但是是否有任何实现允许在sqlite db文件中执行操作?
Are there any MIDP implementation of SQLite db available for use of sqlite db within a MIDlet, rather than using RMS. Of course, there are Floggy and OpenBaseMovil, however they are based on RMS, but are there any implementations that allows to perform operations in an sqlite db file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有两种方法可以做到这一点:
采用 SQLite 的开源代码(用 C 语言编写)并在 JavaME 中编写类似的代码。 还没有人这样做过。 目前正在努力用 C# 编写适用于 Windows Mobile 的 SQLite 版本,但您一定想知道转向无法控制文件系统访问性能的解释性语言会产生什么影响。
定义并实现一个 JavaME API,通过 JNI 等方式访问本机 SQLite。 如果您不是手机制造商或其非常密切的合作伙伴之一,这通常会非常复杂。 我怀疑 Android 这样做是为了让您可以查看该领域的源代码,但它不兼容 MIDP。 目前还没有针对类似 SQLite 的 API 的官方 JSR。
There are 2 ways of doing something like that:
take the open source code of SQLite (written in C) and write something similar in JavaME. nobody has done that yet. There is an ongoing effort to write a version of SQLite in C# for windows mobile but you have got to wonder what impact a move to an interpreted language with no control over the performance of file system access will have.
define and implement a JavaME API that accesses the native SQLite via something like JNI. This is usually extremely complicated if you are not the phone manufacturer or one of its very close partners. I suspect Android does that so you could look at its sources in that area but it won't be MIDP-compliant. There are no official JSR for an SQLite-like API yet.
J2ME 规范没有定义 JNI。 作为 ISV 并尝试编写本机绑定是毫无疑问的。 Sun 的参考实现确实定义了称为 KNI 的东西,但是您必须是 OEM 才能做到这一点并随手机一起提供 VM。
J2ME spec does not define JNI. Being an ISV and trying to write native bindings is out of question. Sun's reference implementation does define something called KNI - but then you have to be an OEM to be able to do that and ship the VM with the phone.