B4J Code Snippet Open Encrypted Sqlite Databases with B4J (SQLCipher)

Download the JDBC from this GitHub, and place it in your Additional folder

In your Main Module, use #AdditionalJar to add your jdbc.

Add JSQL library

The following JDBC has been tested and works fine. You can use any of them
'#AdditionalJar: sqlite-jdbc-3.30.0
'#AdditionalJar: sqlite-jdbc-3.31.1
'#AdditionalJar: sqlite-jdbc-3.35.5.1

'Using the latest Version, you need to download and Add the slf4j API, otherwise you will get Class not found Error
#AdditionalJar: sqlite-jdbc-3.46.0.0
#AdditionalJar: slf4j-api-1.7.36

Find Example Attached
 

Attachments

  • SqlCipher jdbc.zip
    18.8 KB · Views: 84

T201016

Active Member
Licensed User
Longtime User
Hi @mcqueccu
I used your example for testing
And I have to say that there are errors with individual JDBC:

'Working
#AdditionalJar: sqlite-jdbc-3.30.0
#AdditionalJar: sqlite-jdbc-3.31.1
#AdditionalJar: sqlite-jdbc-3.35.5.1

#AdditionalJar: slf4j-api-1.7.36
java.io.FileNotFoundException: Version file is null
java.io.FileNotFoundException: Version file is nul
l
DB Started
#AdditionalJar: sqlite-jdbc-3.46.0.0
#AdditionalJar: slf4j-api-1.7.36

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

DB Started

For now, I have not managed to test other (older) JDBC version.

It can be ignored, of course. But adding:
#AdditionalJar: slf4j-nop-1.7.36
I get no warnings whatsoever. Cleaner log.
 
Last edited:
Top