Error opening SQLite connection on raspberry pi

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 {

            // create a database connection
            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
+2
3

- , , Pi $HOME . , , , .

0

POM

<dependency>
        <groupId>org.xerial</groupId>
        <artifactId>sqlite-jdbc</artifactId>
        <version>3.8.10.1</version>
</dependency>

jar

Powered by: ldd (Debian GLIBC 2.19-18 + deb8u4) 2.19 Copyright (C) 2014 Free Software Foundation, Inc. This is free software; see source of copy conditions. There is no guarantee; even for COMMERCIAL VALUE or SUITABILITY FOR A PARTICULAR PURPOSE. Written by Roland McGrath and Ulrich Drapper.

0
source

All Articles