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 7677229
In Process

The Archive Base Latest Questions

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

I didn’t understand ..why I am facing this error.. Here is my code: package

  • 0

I didn’t understand ..why I am facing this error..

Here is my code:

package com.dswt.book;

import android.content.ContentValues;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class DatabaseHandler extends SQLiteOpenHelper {

    private static final String DATABASE_NAME = "BookManager";
    private static final int DATABSE_VERSION = 1;
    private static final String TABLE_BOOKS = "books";
    private static final String KEY_ID = "id";
    private static final String KEY_NAME = "name";
    private static final String KEY_EDATA = "edata";
    final String TAG = "addBook";

    public DatabaseHandler(Context context) {
        super(context, DATABASE_NAME, null, DATABSE_VERSION);
        // TODO Auto-generated constructor stub
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        String CREATE_BOOK_TABLE = "CREATE TABLE " + TABLE_BOOKS + "(" + KEY_ID
                + " INTEGER PRIMARY KEY," + KEY_EDATA + " TEXT," + KEY_NAME
                + " TEXT " + ")";

        //Log.i(TAG, "error");

        db.execSQL(CREATE_BOOK_TABLE);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        db.execSQL("DROP TABLE IF EXISTS" + TABLE_BOOKS);
        onCreate(db);
    }

    public void addBook(Book book) {
        SQLiteDatabase db = this.getWritableDatabase();

        ContentValues values = new ContentValues();
        values.put(KEY_EDATA, book.getName());
        values.put(KEY_NAME, "book.getEdata());

        db.insert(TABLE_BOOKS, null, values);
        db.close();// closing database connection

        Log.i(TAG, "see the value is adding");
    }

}

Here is my LOG CAT :

03-23 17:44:18.049: I/Database(6094): sqlite returned: error code = 1, msg = table books has no column named edata
03-23 17:44:18.049: E/Database(6094): Error inserting edata=satyam name=data display
03-23 17:44:18.049: E/Database(6094): android.database.sqlite.SQLiteException: table books has no column named edata: , while compiling: INSERT INTO books(edata, name) VALUES(?, ?);
03-23 17:44:18.049: E/Database(6094):   at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
03-23 17:44:18.049: E/Database(6094):   at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:92)
03-23 17:44:18.049: E/Database(6094):   at android.database.sqlite.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:65)
03-23 17:44:18.049: E/Database(6094):   at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:83)
03-23 17:44:18.049: E/Database(6094):   at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:41)
03-23 17:44:18.049: E/Database(6094):   at android.database.sqlite.SQLiteDatabase.compileStatement(SQLiteDatabase.java:1149)
03-23 17:44:18.049: E/Database(6094):   at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1569)
03-23 17:44:18.049: E/Database(6094):   at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1426)
03-23 17:44:18.049: E/Database(6094):   at com.dswt.book.DatabaseHandler.addBook(DatabaseHandler.java:48)
03-23 17:44:18.049: E/Database(6094):   at com.dswt.book.BookActivity.onCreate(BookActivity.java:21)
03-23 17:44:18.049: E/Database(6094):   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
03-23 17:44:18.049: E/Database(6094):   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
03-23 17:44:18.049: E/Database(6094):   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
03-23 17:44:18.049: E/Database(6094):   at android.app.ActivityThread.access$1500(ActivityThread.java:117)
03-23 17:44:18.049: E/Database(6094):   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
03-23 17:44:18.049: E/Database(6094):   at android.os.Handler.dispatchMessage(Handler.java:99)
03-23 17:44:18.049: E/Database(6094):   at android.os.Looper.loop(Looper.java:123)
03-23 17:44:18.049: E/Database(6094):   at android.app.ActivityThread.main(ActivityThread.java:3683)
03-23 17:44:18.049: E/Database(6094):   at java.lang.reflect.Method.invokeNative(Native Method)
03-23 17:44:18.049: E/Database(6094):   at java.lang.reflect.Method.invoke(Method.java:507)
03-23 17:44:18.049: E/Database(6094):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
03-23 17:44:18.049: E/Database(6094):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
03-23 17:44:18.049: E/Database(6094):   at dalvik.system.NativeStart.main(Native Method)
  • 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-31T17:22:34+00:00Added an answer on May 31, 2026 at 5:22 pm

    If you have changed the schema, you will need to increase DATABSE_VERSION (sic) so that the database can be upgraded, and the table will be recreated with the expected columns.

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

Sidebar

Related Questions

Didn't see a question similar to this, so here goes: Let's say I'm running
Didn't even know how to exactly phrase this question, but here is the the
I didn't see any questions that asked this previously so here goes: Once you
I didn't get the answer to this anywhere. What is the runtime complexity of
I didn't see any similar questions asked on this topic, and I had to
I didn't design this table, and I would redesign it if I could, but
I didn't find this in the documentation . Should I just make the close
I didn't fully understand the concept of threads I have some questions. Assume we
I didn't want to ask this as an 'answer' to A Question Someone Beat
I didn’t found short form for this question as subject… Is it possible to

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.