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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:30:49+00:00 2026-06-02T20:30:49+00:00

@Override public void onCreate(SQLiteDatabase db) { try{ db.execSQL(create table + NotificationManager.getUserStatic(context) + log (+

  • 0
@Override
        public void onCreate(SQLiteDatabase db)
        {
            try{
                db.execSQL("create table " +          NotificationManager.getUserStatic(context) + "log ("+
                KEY_TIME +" INTEGER primary key, "+ KEY_TEXT +" TEXT not null);");

            }
            catch (SQLException e) {
                e.printStackTrace();
            }
        }

        /**
         * onOpen method called when app is opening.
         */

        @Override
        public void onOpen(SQLiteDatabase db)
        {
            try{
                System.out.println("tophere");
                db.execSQL("create table if not exists "+DATABASE_NAME+"." + NotificationManager.getUserStatic(context) + "log ("+
                KEY_TIME +" INTEGER primary key, "+ KEY_TEXT +" TEXT not null);");
                System.out.println("downhere");
            }
            catch (SQLException e){
                e.printStackTrace();
            }
        }

We have this code for creating a database for an app. problem is, as far as we can tell, it doesn’t create the tables, so when we try to insert into the tables and read from them, it crashes. we have tried everything, the System.out.println’s are there to see where it fails. we get the tophere out, but it never gets to the downhere part in the log, so we are guessing something is causing it to fail there. we have checked with DDMS that the database is in the correct folder, so the database should be there, but for some reason it cant find it(line 2 and 3 in the log).

Any thoughts?

this is the error log:

04-27 10:45:46.768: I/System.out(6441): tophere
04-27 10:45:46.772: I/SqliteDatabaseCpp(6441): sqlite returned: error code = 1, msg = unknown database NOPO, db=/data/data/dmri.nopo/databases/NOPO
04-27 10:45:46.772: W/System.err(6441): android.database.sqlite.SQLiteException: unknown database NOPO: , while compiling: create table if not exists NOPO.log (time INTEGER primary key, text TEXT not null);
04-27 10:45:46.792: W/System.err(6441):     at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
04-27 10:45:46.792: W/System.err(6441):     at android.database.sqlite.SQLiteCompiledSql.(SQLiteCompiledSql.java:68)
04-27 10:45:46.811: W/System.err(6441):     at android.database.sqlite.SQLiteProgram.compileSql(SQLiteProgram.java:134)
04-27 10:45:46.811: W/System.err(6441):     at android.database.sqlite.SQLiteProgram.compileAndbindAllArgs(SQLiteProgram.java:361)
04-27 10:45:46.811: W/System.err(6441):     at android.database.sqlite.SQLiteStatement.acquireAndLock(SQLiteStatement.java:260)
04-27 10:45:46.811: W/System.err(6441):     at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:84)
04-27 10:45:46.811: W/System.err(6441):     at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1899)
04-27 10:45:46.823: W/System.err(6441):     at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1839)
04-27 10:45:46.823: W/System.err(6441):     at dmri.nopo.DBAdapter$DatabaseHelper.onOpen(DBAdapter.java:67)
04-27 10:45:46.823: W/System.err(6441):     at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:180)
04-27 10:45:46.902: W/System.err(6441):     at dmri.nopo.DBAdapter.open(DBAdapter.java:86)
04-27 10:45:46.912: W/System.err(6441):     at dmri.nopo.LogManager.readLogFile(LogManager.java:32)
04-27 10:45:46.912: W/System.err(6441):     at dmri.nopo.LogActivity.onCreate(LogActivity.java:25)
04-27 10:45:46.921: W/System.err(6441):     at android.app.Activity.performCreate(Activity.java:4465)
04-27 10:45:46.921: W/System.err(6441):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
04-27 10:45:46.931: W/System.err(6441):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
04-27 10:45:46.931: W/System.err(6441):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
04-27 10:45:46.941: W/System.err(6441):     at android.app.ActivityThread.access$600(ActivityThread.java:123)
04-27 10:45:46.941: W/System.err(6441):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
04-27 10:45:46.953: W/System.err(6441):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-27 10:45:46.953: W/System.err(6441):     at android.os.Looper.loop(Looper.java:137)
04-27 10:45:46.972: W/System.err(6441):     at android.app.ActivityThread.main(ActivityThread.java:4424)
04-27 10:45:46.972: W/System.err(6441):     at java.lang.reflect.Method.invokeNative(Native Method)
04-27 10:45:46.972: W/System.err(6441):     at java.lang.reflect.Method.invoke(Method.java:511)
04-27 10:45:46.982: W/System.err(6441):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-27 10:45:46.982: W/System.err(6441):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-27 10:45:46.992: W/System.err(6441):     at dalvik.system.NativeStart.main(Native Method)
04-27 10:45:47.002: I/SqliteDatabaseCpp(6441): sqlite returned: error code = 1, msg = no such table: log, db=/data/data/dmri.nopo/databases/NOPO
04-27 10:45:47.012: D/AndroidRuntime(6441): Shutting down VM
04-27 10:45:47.012: W/dalvikvm(6441): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
04-27 10:45:47.181: E/AndroidRuntime(6441): FATAL EXCEPTION: main
04-27 10:45:47.181: E/AndroidRuntime(6441): java.lang.RuntimeException: Unable to start activity ComponentInfo{dmri.nopo/dmri.nopo.LogActivity}: android.database.sqlite.SQLiteException: no such table: log: , while compiling: SELECT time, text FROM log
04-27 10:45:47.181: E/AndroidRuntime(6441):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at android.app.ActivityThread.access$600(ActivityThread.java:123)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at android.os.Looper.loop(Looper.java:137)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at android.app.ActivityThread.main(ActivityThread.java:4424)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at java.lang.reflect.Method.invokeNative(Native Method)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at java.lang.reflect.Method.invoke(Method.java:511)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at dalvik.system.NativeStart.main(Native Method)
04-27 10:45:47.181: E/AndroidRuntime(6441): Caused by: android.database.sqlite.SQLiteException: no such table: log: , while compiling: SELECT time, text FROM log
04-27 10:45:47.181: E/AndroidRuntime(6441):     at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at android.database.sqlite.SQLiteCompiledSql.(SQLiteCompiledSql.java:68)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at android.database.sqlite.SQLiteProgram.compileSql(SQLiteProgram.java:143)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at android.database.sqlite.SQLiteProgram.compileAndbindAllArgs(SQLiteProgram.java:361)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at android.database.sqlite.SQLiteProgram.(SQLiteProgram.java:127)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at android.database.sqlite.SQLiteProgram.(SQLiteProgram.java:94)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at android.database.sqlite.SQLiteQuery.(SQLiteQuery.java:53)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:47)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1564)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:1449)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1405)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1485)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at dmri.nopo.DBAdapter.getAllSMS(DBAdapter.java:116)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at dmri.nopo.LogManager.readLogFile(LogManager.java:34)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at dmri.nopo.LogActivity.onCreate(LogActivity.java:25)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at android.app.Activity.performCreate(Activity.java:4465)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
04-27 10:45:47.181: E/AndroidRuntime(6441):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
04-27 10:45:47.181: E/AndroidRuntime(6441):     ... 11 more
  • 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-06-02T20:30:51+00:00Added an answer on June 2, 2026 at 8:30 pm

    First of all I would recommend using android.util.Log for logging exceptions in Android.

    Second – I suspect you have tables with wrong names created. Your error says query can’t find “log”, but I see you make some concatenation in “CREATE” statement. That may be the reason.

    You can check what is actually created for you. By viewing the sqlite base created.

    You can try:

    1. adb shell
    2. cd /data/data/<your.package.name>/databases
    3. sqlite3 <yourdbname>
    4. .tables
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

@Override public void onCreate(SQLiteDatabase db) { db.execSQL(DATABASE_CREATE); // providers data // db.execSQL(insert into //
this is my thread: @Override public void run() { Log.d(ConnectionThread,Starting Server Connection); try {
I draw an arc using onDraw(canvas) : @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
I'm creating a new database in my Activity like this: @Override public void onCreate(Bundle
Thread thread = new Thread(new Runnable() { @Override public void run() { try {
In my activity I have for example SQLiteDatabase db = openOrCreateDatabase(Preferences.DB_NAME, Context.MODE_PRIVATE, null); db.execSQL(CREATE
@Override public void onCancel() { // TODO Auto-generated method stub ERROR:The method onCancel() of
I have this code: @Override public void onSurfaceCreated(GL10 gl, EGLConfig config) { GLES20.glClearColor(0, 0,
public class CursorAtStartFocusListener extends FocusAdapter { @Override public void focusGained(java.awt.event.FocusEvent evt) { Object source
In a WebView-derived class I override loadUrl(): @Override public void loadUrl(String url) { super.loadUrl(url);

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.