尝试在 EC2 实例上打开与 DuckDb 的连接时:
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"
我收到以下错误:
Caused by: java.lang.UnsatisfiedLinkError: 'java.nio.ByteBuffer org.duckdb.DuckDBNative.duckdb_jdbc_startup(byte[], boolean)'
at org.duckdb.DuckDBNative.duckdb_jdbc_startup(Native Method)
at org.duckdb.DuckDBDatabase.<init>(DuckDBDatabase.java:22)
开码连接如下:
try {
DuckDBDatabase duckDb = new DuckDBDatabase("jdbc:duckdb:", false);
connection= new DuckDBConnection(duckDb);
} catch (SQLException e) {
throw new RuntimeException("Unable to open DuckDB connection.", e);
}
DuckDb 作为 gradle 中的依赖项添加:
implementation 'org.duckdb:duckdb_jdbc:0.2.4'
相同的代码在 Windows 和 Linux 上本地运行。有任何想法吗?