SQLite and J2ME

你。 提交于 2019-12-01 23:51:32

SQLite is not written in Java so, what you're asking for is either making it available as a non-standard Java API, via some JNI-like interface or translating most of the SQLite source code into pure java code that would presumably use a JSR75 file connection for storage.

The first solution is tantamount to adding a new JSR to the J2ME implementation on the phone, which is usually very hard if not impossible if you're not the phone manufacturer or one of its close partners.

While I haven't looked at that specific part of the source code yet, I suspect this is how the Android platform allows Java developers to use SQLite.

As far as I know, the second solution hasn't been implemented yet (or at least it hasn't been made public) so would require quite some work on your part to make it work. I would be worried about the performance implications of moving SQLite to an interpreted language with very little control on file access performance.

Currently i think it's not possible to use SQLite in J2ME, since there is no officially supported API for SQLite, your only alternative is to use the RecordStore or maybe write directly in the file system.

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