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
0
votes
0 answers

SQLite issue, "SQL error or missing database (near "ON": syntax error)"

I am trying to execute the following SQLite upsert statement: String stmtStr = "INSERT INTO charge_sets(name, description, ref_name) VALUES('test', 'test', 'test') ON CONFLICT(name) DO UPDATE SET description='test', ref_name='test';"; however, when…
Extrreme
  • 1
  • 1
0
votes
1 answer

In SQLite how to backup database from disk into memory using JDBC driver

I wanted to load SQLite database from disk to memory and I'm using JDBC driver, but I couldn't find any proper method in Java to do this. JDBC Driver: implementation group: 'org.xerial', name: 'sqlite-jdbc', version: '3.36.0.3' I found that…
Swastik
  • 144
  • 2
  • 19
0
votes
0 answers

Why is JDBC SQLITE TRUNCATE operation throwing an error?

My program throws an error when I try to execute truncate query using JDBC java with sqlite. import java.sql.*; public class sqlTruncate { public static void main( String args[] ) { try{ Connection c = null; …
APK3065620
  • 11
  • 1
0
votes
1 answer

How could I read SQLite file which will be passed as MultipartFile parameter? (in java/kotlin)

I have to write REST API which will parse an SQLite file and parse&save its data into the server's MySQL DB. The SQLite file will be passed as a .zip file(MultipartFile), so I have to unzip it, and then read the unzipped file as DTO. The code will…
mozzi
  • 63
  • 1
  • 10
0
votes
1 answer

SQLite not Returning all Records from a Table - SQLite-JDB

I have a very large table (1074 records), and I am trying to access it with the following query: PreparedStatement queryColumn = conn.prepareStatement("SELECT * FROM PRAGMA_TABLE_INFO('ImportedCSV')"); ResultSet columns =…
0
votes
0 answers

How can I create a table using Mybatis and SQLite?

I am trying to create a new database and new table using Mybatis and SQLite. I found from previous answers (1, 2, 3) that Mybatis does support using CREATE and ALTER statements, by marking them as "UPDATE" within Mybatis mapper syntax. However,…
Adam Burley
  • 5,551
  • 4
  • 51
  • 72
0
votes
1 answer

not able access sqlite.db file using filepicker(Java Swing Project)

I am not able to access .db file from remote path like jdbc:sqlite:D:\test\fnovel.db jdbc:sqlite:C:\Users\2401k\Nox_share\Download\fnovel.db Project code(not much complicated simple connection) connection =…
0
votes
2 answers

Java: SQLite parameter filling in a PreparedStatement results in an error

I am trying to read data from a SQL database from Java using SQLite-JDBC, but upon filling parameters to a PreparedStatement I am getting an error. Important parts of the code and the error are below. Scanner scanner = new…
Ma100Dev
  • 75
  • 11
0
votes
5 answers

Making a query which selects the news that contain a specific word

CREATE TABLE IF NOT EXISTS news ( title TEXT PRIMARY KEY, newsletter_description TEXT NOT NULL ); I need to write a query which selects all the news that contain the word "apple" or "watermelon"(or both) in their…
Esmer Omer
  • 65
  • 5
0
votes
2 answers

Inserting a specific date in UNIX format into a TABLE

CREATE TABLE IF NOT EXISTS posts ( title VARCHAR , post_description TEXT NOT NULL, time_posted TIMESTAMP, PRIMARY KEY(title) ); UPDATE posts SET time_posted = ???? WHERE time_posted IS NULL; I have a table that represents a post (on any social…
Esmer Omer
  • 65
  • 5
0
votes
1 answer

Sqlite-JDBC update with LIMIT clause?

I am trying to use the update query with the LIMIT clause using sqlite-JDBC. Let's say there are 100 bob's in the table but I only want to update one of the records. Sample code: String name1 = "bob"; String name2 = "alice"; String updateSql =…
HashTables
  • 392
  • 2
  • 7
  • 22
0
votes
1 answer

jdbc:sqlite not retreving data

I am using a jdbc:sqlite to access a sqlite db and get some records with a simple select statement. There are rows in the database but the java function returns nothing. private static String ConnectionString = "jdbc:sqlite:D:\\My…
Pinzel
  • 51
  • 1
  • 10
0
votes
1 answer

Issue with compiled .jar when trying to open it outside of IDE

I've been building a small program with friends. We have been using JavaFX for the program and are too late to use OpenJFX, thus making us use JDK 1.8.0. We are using Maven to compile everything and compiles successfully. The issue is that when we…
0
votes
0 answers

building sqlite-jdbc with custom sqlite version

I try to build sqlite-jdbc on aarch64 machine, using specific version of sqlite that is on my computer. I tried to follow this guide and use autoreconf to build this package, using configure --with-sqlite to this path, but it fails on guessing the…
RD7
  • 628
  • 4
  • 9
  • 20
0
votes
0 answers

Uploading image to django ImageField using jdbc

I am trying to upload image file to a django Image field. All the fields get populated except image. My model is as follows: class ImageModel(models.Model): image_title = models.CharField(max_length=50, null=False, blank=False) uploader =…
optimistic_creeper
  • 2,739
  • 3
  • 23
  • 37