Support loading native lib directly from FS (1.4) #459
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a backport of the PR #450 to
v1.4-andiumstable branch.This PR is a continuation of #447 PR to allow using
duckdb_jdbc-x.x.x.x-nolib.jaralong with a JNI native library, that is loaded directly from file system.It extends the idea from #421 (and supersedes it) implementing the following logic:
if the driver JAR has a bundled native library (for current JVM os/arch), then this library will be unpacked to the temporary directory and loaded from there. If the library cannot be unpacked or loaded - there is no fallback to other methods (it is expected that
-nolibJAR is used for other loading methods)if the driver JAR does not hava a native library bundled inside it, then it will try to load it with:
This call will search the library in
java.library.path(using a platform-specific file name likeduckdb_java.dll) or will use other methods defined by the host application.libduckdb_java.so_linux_amd64) exists in file system next to the driver JAR (in the same directory). If the library file is found there - then the driver will attempt to load it as the last resort.Testing: new test added that covers loading from the same dir and loading by name.
Fixes: #444