May 7, 2026 Replies: 2 Version: 1.00 GitHub: https://github.com/pyhoon/closedb-b4j DescriptionWhen we initialized a sqlite database file with journal mode = WAL, it will create 3 files, a sample.db, sample.db-shm and sample.db-wal files. We may want a single file downloaded from FTP client from our VPS. This tool will set the journal mode to DELETE if it is not, e.g journal mode is WAL. References: https://www.b4x.com/android/forum/threads/b4x-sql-setting-the-journal-mode.136211/ https://www.b4x.com/android/forum/threads/webapp-concurrent-access-to-sqlite-databases.39904/ Installation Download the jar: https://github.com/pyhoon/closedb-b4j/releases/download/v1.00/closedb.jar (3.12MB) Put the jar file inside B4J project or jar path (Objects folder in development) B4J Additional Libraries folder (see the last section at bottom) UsageOption 1: Using Macro to call closedb.jar with argument (most straight forward) Add the following Macro B4X: Copy #Macro: Title, CloseDB, ide://run?File=closedb.jar&Args=sample.db Activate the Macro from B4J IDE Option 2: Using Macro to call closedb.jar without argument Download sample sqlite.ini file: https://github.com/pyhoon/closedb-b4j/releases/download/v1.00/sqlite.ini Note: You can also reuse the sqlite.ini in Pakai Server project Put sqlite.ini inside B4J server app or project Objects folder Edit sqlite.ini with your DbDir and DbFile Add the following Macro B4X: Copy #Macro: Title, CloseDB, ide://run?File=closedb.jar Activate the Macro from B4J IDE Option 3: Using Macro to call closedb.bat batch file Download sample batch file: https://github.com/pyhoon/closedb-b4j/releases/download/v1.00/closedb.bat Put closedb.bat inside B4J server app or project Objects folder Edit closedb.bat to include path of the sqlite db file e.g C:\Java\jdk-19.0.2\bin\java -jar closedb.jar sample.db Add the following Macro B4X: Copy #Macro: Title, CloseDB, ide://run?File=%PROJECT%\Objects\closedb.bat Activate the Macro from B4J IDE Option 4: Using Macro to call closedb.bat batch file and sqlite.ini Download sample batch file: https://github.com/pyhoon/closedb-b4j/releases/download/v1.00/closedb.bat Download sample sqlite.ini file: https://github.com/pyhoon/closedb-b4j/releases/download/v1.00/sqlite.ini Note: You can also reuse the sqlite.ini in Pakai Server project Put sqlite.ini inside B4J server app or project Objects folder Edit sqlite.ini with your DbDir and DbFile Add the following Macro B4X: Copy #Macro: Title, CloseDB, ide://run?File=%PROJECT%\Objects\closedb.bat Activate the Macro from B4J IDE Option 5: Execute closedb.bat batch file Download sample batch file: https://github.com/pyhoon/closedb-b4j/releases/download/v1.00/closedb.bat Put closedb.bat inside B4J server app or project Objects folder Edit closedb.bat to include path of the sqlite db file e.g C:\Java\jdk-19.0.2\bin\java -jar closedb.jar sample.db Execute the closedb.bat Option 6: Execute closedb.bat batch file with path from sqlite.ini (useful for VPS) Download sample batch file: https://github.com/pyhoon/closedb-b4j/releases/download/v1.00/closedb.bat Download sample sqlite.ini file: https://github.com/pyhoon/closedb-b4j/releases/download/v1.00/sqlite.ini Note: You can reuse the sqlite.ini in Pakai Server project Put both files inside B4J server app or project Objects folder Edit sqlite.ini with your DbDir and DbFile Execute the closedb.bat Call from B4J Additional Libraries folderIf you put the closedb.jar inside B4J Additional Libraries folder, update the Macro from B4X: Copy #Macro: Title, CloseDB, ide://run?File=closedb.jar&Args=sample.db to B4X: Copy #Macro: Title, CloseDB, ide://run?File=%ADDITIONAL%\closedb.jar&Args=sample.db Last edited: May 7, 2026 Click to expand...
Version: 1.00 GitHub: https://github.com/pyhoon/closedb-b4j DescriptionWhen we initialized a sqlite database file with journal mode = WAL, it will create 3 files, a sample.db, sample.db-shm and sample.db-wal files. We may want a single file downloaded from FTP client from our VPS. This tool will set the journal mode to DELETE if it is not, e.g journal mode is WAL. References: https://www.b4x.com/android/forum/threads/b4x-sql-setting-the-journal-mode.136211/ https://www.b4x.com/android/forum/threads/webapp-concurrent-access-to-sqlite-databases.39904/ Installation Download the jar: https://github.com/pyhoon/closedb-b4j/releases/download/v1.00/closedb.jar (3.12MB) Put the jar file inside B4J project or jar path (Objects folder in development) B4J Additional Libraries folder (see the last section at bottom) UsageOption 1: Using Macro to call closedb.jar with argument (most straight forward) Add the following Macro B4X: Copy #Macro: Title, CloseDB, ide://run?File=closedb.jar&Args=sample.db Activate the Macro from B4J IDE Option 2: Using Macro to call closedb.jar without argument Download sample sqlite.ini file: https://github.com/pyhoon/closedb-b4j/releases/download/v1.00/sqlite.ini Note: You can also reuse the sqlite.ini in Pakai Server project Put sqlite.ini inside B4J server app or project Objects folder Edit sqlite.ini with your DbDir and DbFile Add the following Macro B4X: Copy #Macro: Title, CloseDB, ide://run?File=closedb.jar Activate the Macro from B4J IDE Option 3: Using Macro to call closedb.bat batch file Download sample batch file: https://github.com/pyhoon/closedb-b4j/releases/download/v1.00/closedb.bat Put closedb.bat inside B4J server app or project Objects folder Edit closedb.bat to include path of the sqlite db file e.g C:\Java\jdk-19.0.2\bin\java -jar closedb.jar sample.db Add the following Macro B4X: Copy #Macro: Title, CloseDB, ide://run?File=%PROJECT%\Objects\closedb.bat Activate the Macro from B4J IDE Option 4: Using Macro to call closedb.bat batch file and sqlite.ini Download sample batch file: https://github.com/pyhoon/closedb-b4j/releases/download/v1.00/closedb.bat Download sample sqlite.ini file: https://github.com/pyhoon/closedb-b4j/releases/download/v1.00/sqlite.ini Note: You can also reuse the sqlite.ini in Pakai Server project Put sqlite.ini inside B4J server app or project Objects folder Edit sqlite.ini with your DbDir and DbFile Add the following Macro B4X: Copy #Macro: Title, CloseDB, ide://run?File=%PROJECT%\Objects\closedb.bat Activate the Macro from B4J IDE Option 5: Execute closedb.bat batch file Download sample batch file: https://github.com/pyhoon/closedb-b4j/releases/download/v1.00/closedb.bat Put closedb.bat inside B4J server app or project Objects folder Edit closedb.bat to include path of the sqlite db file e.g C:\Java\jdk-19.0.2\bin\java -jar closedb.jar sample.db Execute the closedb.bat Option 6: Execute closedb.bat batch file with path from sqlite.ini (useful for VPS) Download sample batch file: https://github.com/pyhoon/closedb-b4j/releases/download/v1.00/closedb.bat Download sample sqlite.ini file: https://github.com/pyhoon/closedb-b4j/releases/download/v1.00/sqlite.ini Note: You can reuse the sqlite.ini in Pakai Server project Put both files inside B4J server app or project Objects folder Edit sqlite.ini with your DbDir and DbFile Execute the closedb.bat Call from B4J Additional Libraries folderIf you put the closedb.jar inside B4J Additional Libraries folder, update the Macro from B4X: Copy #Macro: Title, CloseDB, ide://run?File=closedb.jar&Args=sample.db to B4X: Copy #Macro: Title, CloseDB, ide://run?File=%ADDITIONAL%\closedb.jar&Args=sample.db
Mashiane Expert Licensed User Longtime User May 7, 2026 #2 This assumes a single user database? What happens when other people are connected to the DB? or no one should be executing transactions against the DB? Just asking..
This assumes a single user database? What happens when other people are connected to the DB? or no one should be executing transactions against the DB? Just asking..
aeric Expert Licensed User Longtime User May 7, 2026 #3 It can be use during maintenance or troubleshooting where the server has already stopped.