Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a driver for SQLite in Java?

I did some research on their site, and after some Google-ing, it looks like there are only drivers for C & 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'm doing development on Linux, but I would like to keep my options open. Native libraries would work, but wouldn't give the cross-platform freedom that I'm used to with Java.

like image 259
bakoyaro Avatar asked Nov 03 '25 16:11

bakoyaro


1 Answers

I have used org:xerial:sqlite-jdbc

Example 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)")

(note: 3.6.4 is not the latest version)

like image 90
rlovtang Avatar answered Nov 06 '25 05:11

rlovtang



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!