Hi, here is the error from the logcat of my program.
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
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
And here is my partial code of DBAdapter:
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;
By the way does anyone here knows what does this method do :
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();
}
Thank you.