title: Android SQLite Database Connection not succesfull
body: <p>i encountered a little problem with my current project. I am doing an android application which needs to connect to a SQLite database to work through some statements. I believe the statements etc are fine, my only problem is the fact that the connection to the database is not succesfull.</p>
  
  <p>LogCat Error:</p>
  
  <pre><code>04-18 08:20:30.688: E/Database(304): sqlite3_open_v2("jdbc:sqlite:res/raw/randomdb.db", &amp;handle, 1, NULL) failed
  </code></pre>
  
  <p>So my code so far for connecting to the database is like this:</p>
  
  <pre><code>String url = "jdbc:sqlite:res/raw/randomdb.db";
              SQLiteDatabase db;
              db = SQLiteDatabase.openDatabase(url, null, SQLiteDatabase.OPEN_READONLY);
  </code></pre>
  
  <p>As you can see, i am trying to acces a database which is located in my project/res/raw folder. Does anyone see the mistake?</p>
  
  <p><strong>!!!UPDATE!!!</strong>
  *<em>I tried to go the way with SQLiteOpenHelper, but still encouner an error i cannot seem to solver. Here is my new code:</em>*</p>
  
  <pre><code>public class DatabaseAdapter extends SQLiteOpenHelper {
      private static String dbPath= "data/data/com.YourPackageName/applicationDb/"; 
      private static String dbName = "YourDBName"; 
      private SQLiteDatabase applicationDatabase;  
      private final Context applicationContext;
  
      private boolean checkDataBase(){  
          File dbFile = new File( dbPath +  dbName);
          return dbFile.exists();
      }
  
      public void openDataBase() throws SQLException{
          String fullDbPath= dbPath + dbName;
          applicationDatabase = SQLiteDatabase.openDatabase( fullDbPath,null,SQLiteDatabase.OPEN_READONLY);
      }
  
      @Override
      public void onCreate(SQLiteDatabase db) {
      }
      @Override
      public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { 
      }
  }
  </code></pre>
  
  <p>I get this error:
  <em>Implicit super constructor SQLiteOpenHelper() is undefined for default constructor. Must define an explicit constructor</em>
  Any ideas? Would be great!</p>