sqlite-jdbc-3.7.2.jar is the default SQLite JDBC library comes with B4X IDEs installation but it is quite old.
The good thing about this version is it is very small (
3.05MB only).
The bad thing is, it is a dependency for B4XTable for B4J.
Recently, I tried to execute a SQLite query in B4J which involve using
Window Functions to work with OVER keyword that produce Running Total.
It is only available in
newer version of SQLite 3.25+.
Even though I have specified #AdditionalJar to newer version of SQLite JDBC library, I am getting the following error:
java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (near "(": syntax error)
This has taken me a few days to find what is the root cause since executing the query with DB Browser and tested on a small project works.
I got frustrated.
After several trial and errors, today I finally get the idea to see what happened if I renamed sqlite-jdbc-3.7.2.jar so the project cannot find or ignore this library.
Then I got compilation error that the project is still depends on the old/default sqlite-jdbc-3.7.2.jar
I need to find all the checked dependency libraries one by one, unzipping the b4xlib and view the manifest.txt file.
Finally, I found the only library which has
dependency to sqlite-jdbc-3.7.2.jar is
B4XTable.
I need to edit the manifest.txt to point to another newer version of sqlite-jdbc.jar and put the file back to the b4xlib.
Now my project compiles and able to execute the query without the missing "(" syntax error.
Currently I am pointing the manifest.txt inside B4XTable to sqlite-jdbc-3.39.3.0 which is working fine.
The bad thing is this jar is much bigger (
12.1MB).
I will try to avoid using
sqlite-jdbc-3.43.2.0+ since any version after this requires additional dependency (slf4j-api-2.0.9.jar) but this file is actually quite small (64KB).