Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I make the modified code in SQLite3MultipleCiphers work in sqlite-jdbc-crypt? #103

Closed
iimsoftadmin opened this issue Nov 28, 2023 · 1 comment

Comments

@iimsoftadmin
Copy link

Describe the bug
I modified some code in the SQLite3MultipleCiphers section, then successfully compiled and installed it (make install). Then I recompiled sqlite-jdbc-crypt (make native), executed database operations through jdbc, but the modified code did not take effect. How can I make the modified code work in sqlite-jdbc-crypt?

[make native]
make native SQLITE_OBJ=/usr/local/lib/libsqlite3.so SQLITE_HEADER=/usr/local/include/sqlite3.h

Environment (please complete the following information):
OpenJDK 64-Bit Server VM (build 11.0.20.1+1-post-Ubuntu-0ubuntu122.04, mixed mode, sharing)

@Willena
Copy link
Owner

Willena commented Nov 29, 2023

Then I recompiled sqlite-jdbc-crypt (make native)
[...]
make native SQLITE_OBJ=/usr/local/lib/libsqlite3.so SQLITE_HEADER=/usr/local/include/sqlite3.h

I never tested to build the native library like this; The building process has only been tested using sqlite3 and sqlite3mc amalgamation sources, where the final so is self-sufficient (all .o are assembled into a single shared library. It makes loading simpler for multiplatform support as there is no risk of conflict or missing system-wide .so file)

That being said, linking with the .so should in theory work. The only major difference will be that the native .so will depend on the system-wide installed sqlite3mc library. It means you need to ensure the sqlite3mc.so is can be found at runtime (else you will get "Unsatisfied link errors" at runtime).
Check that your LD_LIBRARY_PATH variable (or other config that indicate where so can be found) is correct and that your native so file shows no issues with ldd (ldd src/main/resources/org/sqlite/native/Linux/x86_64/libsqlitejdbc.so)

How can I make the modified code work in sqlite-jdbc-crypt?

After building the native library, you have two possible choices:

  1. Build the jar package locally: mvn install (build, tests and install the package in your local m2 repository) then import your library as dependency in your Java project

  2. Import the official library from maven as dependency and inject the built lib with system properties -Dorg.sqlite.lib.path=<path/to/folder> -Dorg.sqlite.lib.name=<file_name.so>

@Willena Willena closed this as completed Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants