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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:39:40+00:00 2026-05-20T09:39:40+00:00

I’m working on refining a database that I wrote for my app while ago.

  • 0

I’m working on refining a database that I wrote for my app while ago. The previous database worked fine, but was just messy and I did the stupid thing, try and clean it. This has caused a weird less than helpful error that I can’t begin to decipher. After much back tracking and finally coming back and having the database look, as far as I can tell, identical to my previous DB, I am still getting the cursed error.

The error:

03-02 10:38:30.205: ERROR/AndroidRuntime(505): FATAL EXCEPTION: JobLister: RunThread jobs
03-02 10:38:30.205: ERROR/AndroidRuntime(505): java.lang.IllegalStateException: Invalid tables
03-02 10:38:30.205: ERROR/AndroidRuntime(505):     at android.database.sqlite.SQLiteDatabase.findEditTable(SQLiteDatabase.java:1313)
03-02 10:38:30.205: ERROR/AndroidRuntime(505):     at android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:1414)
03-02 10:38:30.205: ERROR/AndroidRuntime(505):     at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1370)
03-02 10:38:30.205: ERROR/AndroidRuntime(505):     at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1450)
03-02 10:38:30.205: ERROR/AndroidRuntime(505):     at com.android.appion.arm.database.Database.getRecord(Database.java:120)
03-02 10:38:30.205: ERROR/AndroidRuntime(505):     at com.android.appion.arm.database.Database.getRecord(Database.java:107)
03-02 10:38:30.205: ERROR/AndroidRuntime(505):     at com.android.appion.arm.database.Database.getRecord(Database.java:97)
03-02 10:38:30.205: ERROR/AndroidRuntime(505):     at com.android.appion.arm.activities.JobLister.getJobs(JobLister.java:69)
03-02 10:38:30.205: ERROR/AndroidRuntime(505):     at com.android.appion.arm.activities.JobLister.access$3(JobLister.java:66)
03-02 10:38:30.205: ERROR/AndroidRuntime(505):     at com.android.appion.arm.activities.JobLister$2.run(JobLister.java:52)
03-02 10:38:30.205: ERROR/AndroidRuntime(505):     at java.lang.Thread.run(Thread.java:1020)

So naturally I followed the saw trace and saw that it originated from a call I make in one of my activities to the database I have saved in my service (naturally).

The database call from the activity:

Cursor c = mService.getDatabase().getRecord(new Table.Jobs());

This all seems correct. Using the service I get the database, and with the database get all records from the Table jobs.

The getRecord method stepper and the Jobs table definition:

public Cursor getRecord(DataTable table) {
    return getRecord(table, null);
}

public Cursor getRecord(DataTable table, String[] columns) {
    return getRecord(table, columns, null);
}

/**
 * Return a Cursor with every item in which data is only coming from columns,
 * and the records satisfies all selection requirements.
 * @param table The table to query.
 * @param columns The columns to retieve data.
 * @param selection The requirements to base the data collection on. (WHERE statement
 * without WHERE).
 * @return The Cursor full of queried items.
 */
public Cursor getRecord(DataTable table, String[] columns, String selection) {
    return mDB.query(table.TITLE, (columns == null) ? new String[] {"*"} : columns,
        selection, null, null, null, null);
}

And the Table:

public static class Jobs extends DataTable {
    public static final String TITLE = "jobs";
    public static final String[] FIELD = {"job_id",
                                        "job_name", // User given name
                                            "job_contact", // client
                                            "job_location", // The location of the job
                                            "job_notes",
                                            "job_summary", // The byte object of a JobSummary
                                            "wkb_name", // the workbench that is being used for the job
                                            "job_startdate",
                                            "job_enddate"}; 
        public Jobs() { super(); }      
        public String getTable() {
            return "create table " + TITLE +
                "(" + FIELD[0] + " integer primary key autoincrement, " +
                FIELD[1] + " text, " +
                FIELD[2] + " blob, " +
                FIELD[3] + " blob, " +
                FIELD[4] + " text, " +
                FIELD[5] + " blob, " +
                FIELD[6] + " blob, " +
                FIELD[7] + " text, " +
                FIELD[8] + " text " +
                ");";
        }
    }

Now this style of design worked perfectly with my last data base and is now word for word minus the fact that the jobs table extends DataTable for ease of the initial database creation due to abstraction.

Can anyone see anything wrong with this?

EDIT::

I read the source for the error (SQLiteDatabase.findEditTable()) and it seems that the issue it that there is no data in the table. If that were the case I should get a null Cursor return shouldn’t I? Or am I misinterpreting what I’m reading and it really says that the table can’t be found?

  • 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-20T09:39:41+00:00Added an answer on May 20, 2026 at 9:39 am

    Ok, I found out what was wrong. The Invalid tables exception was hiding an error saying the database was created correctly. My bad 😛

    EDIT:: It was an abstraction issue. Since I extended from DataTables but was calling the variable statically, it never properly initialized. The lesson: don’t use abstract classes for tables. Aside from it being very ugly, it doesn’t work as well.

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

Sidebar

Related Questions

No related questions found

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.