Is there a driver for SQLite in Java?

I did some research on my site, and after some Google process, it looks like there are only drivers for C and C ++. Is there an open driver that I can use with SQLLite, or is there a way I can use it with JDBC?

UPDATE

I am developing Linux, but I would like to leave my options open. Native libraries will work, but do not give the cross-platform freedom with which I'm used to Java.

+3
source share
4 answers

SQLite is a native library, so a platform independent solution is not so simple. The SQLiteJDBC project uses an internally sophisticated but working system to access the SQLite database platform independently (on most platforms with good speed). As the name suggests, it can be used via JDBC (see the sample code on the main page).

If you need only one specific platform, you can also use the Java SQLite shell . There are precompiled binaries for windows; sources are also available.

+2
source

SQLite JDBC is completely written in Java, so there are no external dependencies.

+4
source

org: xerial: sqlite-jdbc

Groovy script:

@Grab(group='org.xerial', module='sqlite-jdbc', version='[3.6.4,)')
sql = groovy.sql.Sql.newInstance("jdbc:sqlite:test.db","org.sqlite.JDBC")
sql.execute("create table students(name, age)")

(: 3.6.4 - )

+3

There is also SQLJet, which is a pure java element compatible with sqlite.

+1
source

Source: https://habr.com/ru/post/1780269/


All Articles