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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:53:55+00:00 2026-05-28T05:53:55+00:00

I have created a sub class (DatabaseHelper) of SQLiteOpenHelper Class.Its has a constructor and

  • 0

I have created a sub class (DatabaseHelper) of SQLiteOpenHelper Class.Its has a constructor and two overriden methods

 public DatabaseHelper(Context context) {
            super(context, dbName, null,33);
            // TODO Auto-generated constructor stub
        }
public void onCreate(SQLiteDatabase db) {
        // TODO Auto-generated method stub
        db.execSQL("CREATE TABLE "+ quizTable +"("+quizCol1+" INTEGER PRIMARY KEY,"+
                quizCol2+" TEXT,"+ quizCol3 +" TEXT,"+ quizCol4 +" INTEGER," + quizCol5 + " DATETIME )");

        db.execSQL("CREATE TABLE "+ questionTable +"("+questionCol1+" INTEGER PRIMARY KEY,"+
                questionCol2+" INTEGER,"+ questionCol3 +" TEXT,"+ questionCol4 +" TEXT," + questionCol5 + " TEXT," +
                questionCol6 + " TEXT," + questionCol7 +" TEXT," + questionCol8 +" TEXT)");

        db.execSQL("CREATE TABLE "+ playedQuizzes +"("+playedQuizCol1+" INTEGER PRIMARY KEY,"+
                playedQuizCol2+" TEXT,"+ playedQuizCol3 +" TEXT,"+ playedQuizCol4 +" TEXT," +
                playedQuizCol5 + " TEXT)");
        System.out.println("this is onCreate method");
        InsertQuiz();
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        // TODO Auto-generated method stub
        db.execSQL("DROP TABLE IF EXISTS "+questionTable);
        db.execSQL("DROP TABLE IF EXISTS "+playedQuizzes);

        onCreate(db);
    }

In my Activity subclass i have called the constructor of above class using

 public void onStart(){
        try{
            super.onStart();
             dbHelper = new DatabaseHelper(this);
        }catch(Exception ex){
            CatchError(ex.toString());
        }       
    }

But when i run my Activity class and open my DDMS perspective then i did not find any database created under /data/data/

Is there something wrong with my knowlege or my code? If yes please tell me.

  • 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-28T05:53:56+00:00Added an answer on May 28, 2026 at 5:53 am

    From the documentation of the SQLiteOpenHelper class:

    Create a helper object to create, open, and/or manage a database. This
    method always returns very quickly. The database is not actually
    created or opened until one of getWritableDatabase() or
    getReadableDatabase() is called.

    So the database doesn’t get created before not calling getWritableDatabase() or getReadableDatabase().

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

Sidebar

Related Questions

I have created a class with 3 sub classes in Java. The 3 sub
I have simple ontology called campus.owl.There is a class calledLecturer and which has two
I have created a Sub-Class of NSOutlineView and used the below code to make
I have created a VB.NET Class Library that exposes some COM Interop sub routines.
I have a sub-class of NSManagedObject, most of the properties are dynamic (created by
I have a UITableViewCell (with associated UITableViewCell sub class, .m & .h) created in
I have created a UserControl that has a ListView in it. The ListView is
I have the following windows service file: Imports System.ServiceProcess Imports System.IO Public Class fswService
In an asp.net webforms app I have created a base class for my pages
in my data layer class I have created a function to manually refresh the

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.