简体   繁体   中英

SQLite and J2ME

is it possible to use SQLite for a j2me application ? has anyone ever tried to do so ?

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.

目前,我认为无法在J2ME中使用SQLite,因为没有官方支持的SQLite API,您唯一的选择是使用RecordStore或直接在文件系统中写入。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM