I extracted the iOS 6 sms db from an iTunes backup of my iPhone. It is a sqlite3 db.

When I query it in a Terminal, it works fine:

```
$ sqlite3 sms.db
sqlite> select * from message;

```

But when I try to query it with [xerial sqlite-jdbc](https://bitbucket.org/xerial/sqlite-jdbc/) I get a [SQLITE\_NOTADB].

This is the code I use:

```
public class Sample {
    public static void main(String[] args) throws ClassNotFoundException {
        String dbFilePath = args[0];
        File dbFile = new File(dbFilePath);
        if (!dbFile.exists()) {
            throw new IllegalArgumentException(String.format("%s does not exist", dbFilePath));
        }

        // load the sqlite-JDBC driver using the current class loader
        Class.forName("org.sqlite.JDBC");

        Connection connection = null;
        try {
            // create a database connection
            connection = DriverManager.getConnection(String.format("jdbc:sqlite:%s", dbFilePath));
            Statement statement = connection.createStatement();
            statement.setQueryTimeout(30);  // set timeout to 30 sec.

            ResultSet rs = statement.executeQuery("select * from message");
            while (rs.next()) {
                // read the result set
                System.out.println(rs.getString("text"));
            }
        } catch (SQLException e) {
            // if the error message is "out of memory",
            // it probably means no database file is found
            System.err.println(e.getMessage());
        } finally {
            try {
                if (connection != null)
                    connection.close();
            } catch (SQLException e) {
                // connection close failed.
                System.err.println(e);
            }
        }
    }
}

```

I use xerial sqlite-jdbc 3.7.2 on OSX Mountain Lion.