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

The Archive Base Latest Questions

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

I have a pre-made SQLite database that I am downloading from the net via

  • 0

I have a pre-made SQLite database that I am downloading from the net via an AsyncTask. It downloads the file and stores it on the sdcard in /data/databases/ I have checked the database file and it is successfully downloading and has all the appropriate tables and data but every time I try and open the database and display the stored data I get the following

    03-19 18:43:10.204: E/AndroidRuntime(3057): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ondrovic.downloader/com.ondrovic.downloader.Main}: android.database.sqlite.SQLiteException: no such table: beers: , while compiling: SELECT * FROM beers ORDER BY _id

which makes no sense because the table is there

maybe my databasehelper class is wrong or I am calling it wrong.

here is my database.java

   package com.ondrovic.downloader;

   import java.io.File;

   import android.content.Context;
   import android.database.sqlite.SQLiteDatabase;
   import android.database.sqlite.SQLiteOpenHelper;
   import android.os.Environment;

   public class Database extends SQLiteOpenHelper{
//File rDIR = Environment.getExternalStorageDirectory();
private static String DBPATH = "/data/databases/BOOMBOZZ/";
private static String DBNAME = "boombozz.db";
private static int DBVER = 1;

private SQLiteDatabase db;
private final Context dbContext;

public Database(Context context) {
    super(context, DBNAME, null, DBVER);
    this.dbContext = context;
}

public void open() {
    String myPath = DBPATH + DBNAME;
    db = SQLiteDatabase.openDatabase(Environment.getExternalStorageDirectory() + myPath, null, SQLiteDatabase.OPEN_READWRITE);
}

public synchronized void close() {

    db.close();
    super.close();
}

@Override
public void onCreate(SQLiteDatabase db) {
    // TODO Auto-generated method stub

}

@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    // TODO Auto-generated method stub

   }
}

And here is where I am calling it in my main class

 db = (new Database(this)).getWritableDatabase();

Any suggestions?

Thanks

  • 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:20:24+00:00Added an answer on May 31, 2026 at 5:20 pm

    maybe my databasehelper class is wrong

    Yes.

    You need to implement onCreate() and onUpgrade() on a SQLiteOpenHelper subclass. You, for whatever reason, decided not to do that. As a result, your SQLiteOpenHelper will not work.

    However, since SQLiteOpenHelper is not designed to support your download-the-database scenario, you should just make Database not extend SQLiteOpenHelper, and open and close the database yourself, as you are already partially doing.

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

Sidebar

Related Questions

I have a pre-baked sqlite database that I want to use in my Android
Folks, My Issue Why is an HSQLDB file-based database I have pre-populated with a
I have a pre-made Word Template that has a table. I would like to
I have a pre tag within my page that contains quite a bit of
I have a project that comprises pre-build Dll modules, built some time in the
I have a form that I pre-populate with test data though jQuery. $('INPUT[name=subscription.FirstName]').val('Jef'); but
I have to create a site definition for a client that must contain pre-defined
Currently we have 2 databases that we are going to use. One comes from
I have programmed a simple Jquery ticker (using a pre-made Javascript) to display tweets
I have made an application in djnago and using pre made admin application of

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.