The Share My Creation SQLite DB Browser (for encrypted files) from ilan give use the possibility to create and open an encrypted SQLite database. However, the database file is created in debug mode in the objects directory.
Calling getFileName creates the encrypted database in the objects directory, but calling getDb returns an java.lang.reflect.InvocationTargetException error code.
What is the correct way to open the encrypted database in the XUI.DefaultFolder?
Initialize the encrypted SQLite database:
Sub initializeSQL
dataDb.Initialize("org.sqlite.JDBC",$"jdbc:sqlite:file:${getDb}?cipher=sqlcipher&legacy=4&kdf_iter=256000&key=${getKey}"$)
End Sub
Sub getKey As String
Return "xxxxxx" '<--- enter here your key (the same key is the password for the sqlite chiper app)
End Sub
Sub getDb as String
xui.SetDataFolder("Databases")
Dim DirString As String = $"${xui.DefaultFolder}\\${getFileName}"
' Change all single "\" to "\\"
Dim wNewWord As String = DirString.replace("\", "\\")
Log(wNewWord)
Return wNewWord
End Sub
Public Sub getFileName() As String
Return "data.db"
End Sub
Calling getFileName creates the encrypted database in the objects directory, but calling getDb returns an java.lang.reflect.InvocationTargetException error code.
What is the correct way to open the encrypted database in the XUI.DefaultFolder?