Questions tagged [sqlitejdbc]

SQLite JDBC is the JDBC interface of SQLite database. It supports both single thread and thread-safe operation modes. Questions tagged by this tag should also be tagged Sqlite.

SQLite JDBC is the JDBC interface of SQLite database.

There are multiple JDBC drivers for this database:

  • Xerial that uses the packaged native libraries for different platforms. The authors claim that using native code makes the driver faster.
  • the Zentus that is pure Java-only implementation. The initial project page is here but seems not available at the time of writing. The backed up content can be found here in GitHub.

Both can be easily added to project by just adding them to classpath.

The thread safety of the SQLite JDBC connection depends on the SQLite operation mode and can be single thread, multiple thread but only one per connection and serialized (no restrictions). The operation mode should be selected at compile time. With certain limitations, it can be further changed at start time, some changes are also possible at run time.

62 questions
2
votes
1 answer

Sqlite does not detect unique key on a table despite primary key being present

I am trying to remove a record from sqlite database. I use dbeaver program for all operations. So when the action is performed, following error is shown: The error says that unique key is not present. Query for table creation was this: CREATE…
Alex
  • 4,607
  • 9
  • 61
  • 99
2
votes
0 answers

sqlite-jdbc-3.8.11.1 on raspberry pi - Internal Error (os_linux_zero.cpp:254)

I used sqlite-jdbc-3.7.2 but wanted to upgrade to the current release sqlite-jdbc-3.8.11.1 here is some sample code public boolean open() { try { con = DriverManager.getConnection(String.format("jdbc:sqlite:%s", …
user2071938
  • 2,055
  • 6
  • 28
  • 60
2
votes
3 answers

Insert vector elements to database FAST

I have the following database: CREATE TABLE person_bornYear (name, year INT, prob FLOAT); And I have a vector with object (PersonYear) that contains person elements: String name, int year, double prob. I try to insert the vector elements to the…
gran33
  • 12,421
  • 9
  • 48
  • 76
1
vote
1 answer

SQLite foreign key constraints

I am using Java with SQLiteJDBC. I was struggling to understand why my foreign keys were not acting as constraints, until I read the following: Prior to version 3.6.19, SQLite did not support foreign key constraints. I then took a closer look at the…
c24w
  • 7,421
  • 7
  • 39
  • 47
1
vote
3 answers

How to check whether netconnection is available or not in iPhone?

I have an application in which I have login form which username and password textfields. when user enter his/her username and password and click on the submit button, then it will go to server API database and check whether user is valid or not. If…
Rani
  • 3,333
  • 13
  • 48
  • 89
1
vote
1 answer

SQLite in-memory database encounters SQLITE_LOCKED_SHAREDCACHE intermittently

I am using mybatis 3.4.6 along with org.xerial:sqlite-jdbc 3.28.0. Below is my configuration to use an in-memory database with shared mode enabled db.driver=org.sqlite.JDBC db.url=jdbc:sqlite:file::memory:?cache=shared The db.url is correct…
machinarium
  • 631
  • 6
  • 17
1
vote
1 answer

Connecting to SQLite Database Fails

I am attempting to access my SQLite3 database in a Java Applet. When I run my code to connect to the database I get this error No suitable driver found for a.db, how can I fix it? Now I am not entirely sure I have actually installed the correct…
Mack
  • 11
  • 1
  • 2
1
vote
0 answers

ERROR (java.sql.SQLException)

i am tryin to use sqlite-jdbc in android but give me error when trying to connect to database. below my code . Class .forName("org.sqlite.JDBC").newInstance(); c = DriverManager.getConnection("jdbc:sqlite:category1.db"); } catch (…
1
vote
2 answers

sqlite jdbc error SQLITE_IOERR_LOCK

I have a runnable jar for a java8 program which uses sqlite-jdbc 3.14.2. It works fine on windows 10 and ubuntu. i.e. i can query stuff on these platforms on all the tables. However, when i run it on FreeBSD 10.3-releasep4, it gives me the following…
muzammil
  • 11
  • 2
1
vote
1 answer

Wildfly being killed by sqlite jdbc

I have a task which was working fine with javaSE application for about a year. That is: extracting blobs and text metadata from sqlite databases and populating big RDBMS. When I moved this task to Wildfly (tried 10.0 and yesterday 10.1 also),…
Oleg Gritsak
  • 548
  • 7
  • 26
1
vote
0 answers

Saving dynamic content with SQL

I've got a Problem with the structure/SQL technique I am currently using (SQLite with Java). I got my Client table and Project table running and working with all its keys blabla. But now I am trying to setup the table for the Pit objects. And the…
Max Wolf
  • 11
  • 3
1
vote
1 answer

Logstash additional JARs

I'm trying to add a custom filter to Logstash 1.4.2, which is installed as a Debian package. The contrib plugins (http://logstash.net/docs/1.4.2/contrib-plugins) are also installed. This filter establishes a connection to an sqlite database, and for…
nuqqsa
  • 4,511
  • 1
  • 25
  • 30
1
vote
0 answers

Why is this query answered instantly by the sqlite3 application, but slowly using sqlitejdbc?

I'm using Mac OS X v10.4.11 with the standard Java (1.5.0_19) and sqlite3 (3.1.3) that came it. (Yeah, a little old... but see comment below.) I have a sqlite3 database with a table with a few hundred thousand rows, with "name" and "stored" text…
Gary H
  • 81
  • 1
  • 4
1
vote
2 answers

How to Logically DELETE a record in SQLite

I would like to mark a record as deleted instead of actually deleting a record. My intention is to use an instead of trigger, but I am getting an SQLException that neither I nor Google know how to solve this. My code: CREATE TRIGGER IF NOT…
Christoff Erasmus
  • 925
  • 1
  • 10
  • 26
0
votes
1 answer

How to improve JDBC performance with my application

Here is the basic outline of my application (which connects to a SQlLite DB): It scans a directory a creates a list of 8-15 different flat files that need to be read. It identifies the flat file and chooses a generic prepared statement based on the…
Tim Brooks
  • 162
  • 11