On linux, java uses javasqlite and linuxjavasqlite.
Use objective qlite in java on linux
Http://www.ch-werner.de/javasqlite/
1) download:
Http://www.ch-werner.de/javasqlite/javasqlite-20140624.tar.gz
2) decompress the package and enter the directory for compilation.
$ Javasqlite-20140624 cd
$./Configure
$ Make
3) Copy libsqlite_jni.so to the/usr/lib64 directory.
$ Sudo cp. libs/libsqlite_jni.so/usr/lib64
If the previous step is not executed, an error is returned:
Unable to load sqlite_jni: java. lang. UnsatisfiedLinkError: no sqlite_jni in java. library. path
4) import sqlite. jar to the java project.
5) Use sqlite java wrapper:
Import SQLite. Database;
...
Database db = new Dababase ();
Db. open (dbFile, SQLite. Constants. SQLITE_OPEN_READWRITE |
SQLite. Constants. SQLITE_OPEN_CREATE |
SQLite. Constants. SQLITE_OPEN_FULLMUTEX );
Db.exe c ("create table...", null );
To open sqlite db, refer:
Http://blog.csdn.net/yifanernei/article/details/5642127