Note that there are some explanatory texts on larger screens.

plurals
  1. POError with android DBAdapter class
    primarykey
    data
    text
    <p>here is the error from the logcat of my program.</p> <p>06-24 01:35:04.213: INFO/ActivityManager(587): Starting activity: Intent { comp={one.two/one.two.Arrival} } 06-24 01:35:04.521: ERROR/DBDroid(1048): android.database.sqlite.SQLiteException: no such table: port: , while compiling: SELECT KEY_STATUS, KEY_ID, KEY_ARRIVAL, KEY_DESTINATION, KEY_FERRY FROM ferry 06-24 01:35:05.026: INFO/ActivityManager(587): Displayed activity one.two/.Arrival: 805 ms</p> <p>It seems that it is stated that there is no table called port. But i do have a table called port placed into the emulator , under data/data/one.two/databases</p> <p>And here is my partial code of DBAdapter:</p> <pre><code> public class DBAdapter extends ListActivity { public static String KEY_STATUS = "status"; public static String KEY_ID = "id"; public static String KEY_ARRIVAL = "arrival"; public static String KEY_DESTINATION = "destination"; public static String KEY_FERRY = "ferry"; private static final String DATABASE_NAME = "ferry"; private static final String DATABASE_TABLE = "port"; private static final int DATABASE_VERSION = 1; private static Context context; private static DatabaseHelper DBHelper; private static SQLiteDatabase db; </code></pre> <p>By the way does anyone here knows what does this method do :</p> <pre><code>public DBAdapter(Context ctx) { this.context = ctx; DBHelper = new DatabaseHelper(context); } private static class DatabaseHelper extends SQLiteOpenHelper { DatabaseHelper(Context context) { super(context, "ferry", null, 1); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { } @Override public void onCreate(SQLiteDatabase db) { } }//end DatabaseHelper // ---opens the database--- public DBAdapter open() throws SQLException { db = DBHelper.getWritableDatabase(); return this; } // ---closes the database--- public void close() { DBHelper.close(); } </code></pre> <p>Thank you.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload