title: xerial sqlite-jdbc 3.7.2 returns [SQLITE_NOTADB] on OSX Mountain Lion
body: <p>I extracted the iOS 6 sms db from an iTunes backup of my iPhone. It is a sqlite3 db.</p>
  
  <p>When I query it in a Terminal, it works fine:</p>
  
  <pre><code>$ sqlite3 sms.db
  sqlite&gt; select * from message;
  </code></pre>
  
  <p>But when I try to query it with <a href="https://bitbucket.org/xerial/sqlite-jdbc/" rel="nofollow">xerial sqlite-jdbc</a> I get a [SQLITE_NOTADB].</p>
  
  <p>This is the code I use:</p>
  
  <pre><code>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);
              }
          }
      }
  }
  </code></pre>
  
  <p>I use xerial sqlite-jdbc 3.7.2 on OSX Mountain Lion.</p>