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

  • Home
  • SEARCH
  • 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 283037
In Process

The Archive Base Latest Questions

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

I created the SQLite database the following way: private static final String DATABASE_CREATE =

  • 0

I created the SQLite database the following way:

private static final String DATABASE_CREATE = "create table " + DATABASE_TABLE_SETTINGS + " (" +
KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
KEY_NAME + " INTEGER UNIQUE not null, " +
VALUE + " TEXT not null);" + 

"create table " + DATABASE_TABLE_RECORDINGS + " (" +
KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
RECORDING_FILENAME + " TEXT UNIQUE NOT NULL, " +
RECORDING_TITLE + " TEXT NOT NULL, " +
RECORDING_TAGS + " TEXT, " +
RECORDING_LOCATION + " TEXT, " +
RECORDING_TIME + " TEXT);";

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

I try to store a new entry by calling the following method:

public long insertRecordingInfo(String filename, String title, String tags, int privacyLevel, String location, String recordingTime){
    long res = -1;
    ContentValues recordingInfoParameters = new ContentValues();
    recordingInfoParameters.put(RECORDING_FILENAME, filename);
    recordingInfoParameters.put(RECORDING_TITLE, title);
    recordingInfoParameters.put(RECORDING_TAGS, tags);
    recordingInfoParameters.put(RECORDING_PRIVACY_LEVEL, privacyLevel);
    recordingInfoParameters.put(RECORDING_LOCATION, location);
    recordingInfoParameters.put(RECORDING_TIME, recordingTime);

    if(db != null){
        res = db.insert(DATABASE_TABLE_RECORDINGS, null, recordingInfoParameters);
    }
    return res;
}

but the db.insert() returns -1 (it doesn’t store a new entry) and it returns an IllegalStateException:

java.lang.IllegalStateException: /data/data/dev.client.android/databases/clientDB.db SQLiteDatabase created and never closed

Does anyone know what’s wrong here and how it could be fixed?

  • 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-12T05:20:23+00:00Added an answer on May 12, 2026 at 5:20 am

    From the reference:

    Multiple statements separated by ;s
    are not supported.

    Could that be the problem?

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

Sidebar

Related Questions

Does anybody know if there is a way to create an SQLite database based
So what's the best way to create new tables in a Sqlite database in
I have an SQL Server database table created by deploying the following description in
I have created a Python module that creates and populates several SQLite tables. Now,
I am using a SQLite database to store values from a data logger. The
I created the following route: map.todo todo/today, :controller => todo, :action => show_date Originally,
In my app I sometimes need to rebuild and repopulate database file. SQLite databse
My application uses an SQLite database with FTS3. The results of a query shall
I'm trying to use SqlAlchemy to make Sqlite database tables inside of Pylons. I'm
I've been trying to get foreign keys working within my Android SQLite database. I

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.