Update: I just check the last JDBC jar I use and it skips the /Linux/arm/libsqlitejdbc.so card. Did you get this problem by downloading this file from somewhere? Unable to find it anywhere.
Edit: the problem seems like this, however I don’t know how to fix it.
Caused by: java.lang.Exception: Error loading native library: /org/sqlite/native/Linux/arm/libsqlitejdbc.so
I am trying to use a SQLite database on my raspberry pi. However, I cannot get it to work. I get the output posted below. I am using the JDBC driver. The code works fine on my main computer. I searched everywhere but cannot find a solution. I packed my code in a Jar file, if that matters.
Relevant Code:
private final String dbLocation = "jdbc:sqlite:" + System.getProperty("user.home") + "/ServerSQLite.db";
public SQLServer() throws ClassNotFoundException {
System.out.println("DB location: " + dbLocation);
Connection connection = null;
Class.forName("org.sqlite.JDBC");
try {
connection = DriverManager.getConnection(dbLocation);
Conclusion:
DB location: jdbc:sqlite:/usr/share/tomcat7/ServerSQLite.db
Error opening connection
Edit: The same hard code issue that should have both read and write permissions:
jdbc:sqlite:/home/pi/ServerSQLite.db
Error opening connection
, :)
2: , , :
java.sql.SQLException: Error opening connection
...Lots of exception
Caused by: java.lang.Exception: Error loading native library: /org/sqlite/native/Linux/arm/libsqlitejdbc.so
at org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:241)
...
at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:175)
... 29 more
Error opening connection
, -, :
java.lang.Exception: Error loading native library: /org/sqlite/native/Linux/arm/libsqlitejdbc.so