Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7659741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:22:21+00:00 2026-05-31T13:22:21+00:00

I have a strange problem on an android application, I have no such table

  • 0

I have a strange problem on an android application, I have no such table exception, but I’m sure that the database exists. For some that will redirect me to the other posts here I would like to add that I’m trying the app on my own cell phone not a an emulator, this because I read a lot of questions here that talk about the same problem on emulator.

Any ideas or hint will be greatly appreciated.

the code of activity with the error:

...

public class chartView extends Activity{
    Button editbtm;
    Button cleanbtm;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.chart_layout);  
        editbtm = (Button) findViewById(R.id.editBasketbtm);
        cleanbtm = (Button) findViewById(R.id.cleanBasketbtm);
        //fletch all goods that should be presented on the text View
        dbAdapter goodsfletcher = new dbAdapter(chartView.this); 
    //  goodsfletcher.createGoodsTable();
        goodsfletcher.open();
        ...

the code of teh dbADapter class:

public class dbAdapter {

    public static final String KEY_ARTI = "ARTI";
    public static final String KEY_PROV = "PROV";
    public static final String KEY_CODART = "CODART";
    public static final String KEY_PRECBOL ="PRECBOL";
    public static final String KEY_QUANT ="QUANT";

    private static final String TAG = "DbAdapter";
    private DatabaseHelper mDbHelper;
    private SQLiteDatabase mDb;


    private static final String DATABASE_CREATE = "create table goods ( CODART VARCHAR(10) primary key, ARTI varchar(50) not null, PROV varchar(15) not null, PRECBOL FLOAT(6,2) not null, QUANT int not null);";

    private static final String DATABASE_NAME = "ketanoBase";
    private static final String DATABASE_TABLE = "goods";
    private static final int DATABASE_VERSION = 1;

    private final Context mCtx;

    private static class DatabaseHelper extends SQLiteOpenHelper {

        DatabaseHelper(Context context) {
            super(context, DATABASE_NAME, null, DATABASE_VERSION);
        }

        @Override
        public void onCreate(SQLiteDatabase db) {
            db.execSQL(DATABASE_CREATE);
        }

        @Override
        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
            Log.w(TAG, "Upgrading database from version " + oldVersion + " to "
                    + newVersion + ", which will destroy all old data");
            db.execSQL("DROP TABLE IF EXISTS goods");
            onCreate(db);
        }
    }


    public dbAdapter(Context ctx) {
        this.mCtx = ctx;
    }


    public dbAdapter open() throws SQLException {
        mDbHelper = new DatabaseHelper(mCtx);
        mDb = mDbHelper.getWritableDatabase();
        return this;
    }

    public void close() {
        mDbHelper.close();
    }



    public void addĜood(String code, String title, String source, String quantity, String price  ) {
        ContentValues initialValues = new ContentValues();
        initialValues.put(KEY_ARTI, title);
        initialValues.put(KEY_CODART, code);
        initialValues.put(KEY_PROV, source);
        initialValues.put(KEY_PRECBOL, price);
        initialValues.put(KEY_QUANT, quantity);
        mDb.insert(DATABASE_TABLE, code, initialValues);

    }


    public boolean deleteGood(long rowId) {

        return mDb.delete(DATABASE_TABLE, KEY_CODART + "=" + rowId, null) > 0;
    }

    public void eraseGoods(){
        String sql = "drop table if exists goods";
        mDb.execSQL(sql);
    }


    public Cursor fetchAllGoods() {

        return mDb.query(DATABASE_TABLE, new String[] {KEY_CODART, KEY_ARTI,
                KEY_PROV, KEY_PRECBOL, KEY_QUANT}, null, null, null, null, null);
    }

    public Cursor fetchGood(long rowId) throws SQLException {

        Cursor mCursor =

                mDb.query(true, DATABASE_TABLE, new String[] {KEY_CODART,
                        KEY_ARTI, KEY_PROV,KEY_PRECBOL, KEY_QUANT}, KEY_CODART + "=" + rowId, null,
                        null, null, null, null);
        if (mCursor != null) {
            mCursor.moveToFirst();
        }
        return mCursor;

    }


    public boolean updateGood(long rowId, String quantity) {
        ContentValues args = new ContentValues();

        args.put(KEY_QUANT,quantity);

        return mDb.update(DATABASE_TABLE, args, KEY_CODART + "=" + rowId, null) > 0;
    }
}

The LogCat og the error:

03-14 09:52:05.668: W/KeyCharacterMap(30808): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
03-14 09:52:06.384: D/AndroidRuntime(30808): Shutting down VM
03-14 09:52:06.384: W/dalvikvm(30808): threadid=1: thread exiting with uncaught exception (group=0x40018560)
03-14 09:52:06.394: E/AndroidRuntime(30808): FATAL EXCEPTION: main
03-14 09:52:06.394: E/AndroidRuntime(30808): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.remotedata.firstapp/com.remotedata.firstapp.chartView}: android.database.sqlite.SQLiteException: no such table: goods: , while compiling: SELECT CODART, ARTI, PROV, PRECBOL, QUANT FROM goods
03-14 09:52:06.394: E/AndroidRuntime(30808):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1768)
03-14 09:52:06.394: E/AndroidRuntime(30808):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1784)
03-14 09:52:06.394: E/AndroidRuntime(30808):    at android.app.ActivityThread.access$1500(ActivityThread.java:123)
03-14 09:52:06.394: E/AndroidRuntime(30808):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:939)
03-14 09:52:06.394: E/AndroidRuntime(30808):    at android.os.Handler.dispatchMessage(Handler.java:99)
03-14 09:52:06.394: E/AndroidRuntime(30808):    at android.os.Looper.loop(Looper.java:130)
03-14 09:52:06.394: E/AndroidRuntime(30808):    at android.app.ActivityThread.main(ActivityThread.java:3835)
03-14 09:52:06.394: E/AndroidRuntime(30808):    at java.lang.reflect.Method.invokeNative(Native Method)
03-14 09:52:06.394: E/AndroidRuntime(30808):    at java.lang.reflect.Method.invoke(Method.java:507)
03-14 09:52:06.394: E/AndroidRuntime(30808):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
03-14 09:52:06.394: E/AndroidRuntime(30808):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
03-14 09:52:06.394: E/AndroidRuntime(30808):    at dalvik.system.NativeStart.main(Native Method)
03-14 09:52:06.394: E/AndroidRuntime(30808): Caused by: android.database.sqlite.SQLiteException: no such table: goods: , while compiling: SELECT CODART, ARTI, PROV, PRECBOL, QUANT FROM goods
03-14 09:52:06.394: E/AndroidRuntime(30808):    at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
03-14 09:52:06.394: E/AndroidRuntime(30808):    at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:92)
03-14 09:52:06.394: E/AndroidRuntime(30808):    at android.database.sqlite.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:65)
03-14 09:52:06.394: E/AndroidRuntime(30808):    at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:83)
03-14 09:52:06.394: E/AndroidRuntime(30808):    at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:49)
03-14 09:52:06.394: E/AndroidRuntime(30808):    at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:42)
03-14 09:52:06.394: E/AndroidRuntime(30808):    at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1356)
03-14 09:52:06.394: E/AndroidRuntime(30808):    at android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:1235)
03-14 09:52:06.394: E/AndroidRuntime(30808):    at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1189)
03-14 09:52:06.394: E/AndroidRuntime(30808):    at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1271)
03-14 09:52:06.394: E/AndroidRuntime(30808):    at com.remotedata.firstapp.dbAdapter.fetchAllGoods(dbAdapter.java:138)
03-14 09:52:06.394: E/AndroidRuntime(30808):    at com.remotedata.firstapp.chartView.onCreate(chartView.java:31)
03-14 09:52:06.394: E/AndroidRuntime(30808):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
03-14 09:52:06.394: E/AndroidRuntime(30808):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1722)
03-14 09:52:06.394: E/AndroidRuntime(30808):    ... 11 more
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T13:22:22+00:00Added an answer on May 31, 2026 at 1:22 pm

    I believe that the database file exists, but the table doesn’t exist as the error says. Have you tried deleting the database file and running again? Since the file exists, DatabaseHelper.onCreate() won’t be called. It will only be called if the file doesn’t exist and a new database is created.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a strange problem with Android 1.6 I have an application that has
i have a strange (?) error in my android application. I have defined some
I have a java application that stores some GPS data in a strange format:
I have a strange problem in my android application. I am starting one activity
I am having a strange problem in an Android application that I am building,
I have a strange problem with mod_rewrite, the rules that are relevant here are:
I have a strange problem that is only happening in a single location. I
I have a strange problem with some documents on my webpage. My data is
I have a strange problem that I could not solve. When I try to
I have a very strange problem with Android animations, I tried many different approaches

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.