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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:18:05+00:00 2026-06-09T23:18:05+00:00

public class DataBaseHelper extends SQLiteOpenHelper { private static String DB_NAME; private static String DB_PATH

  • 0
          public class DataBaseHelper extends SQLiteOpenHelper
          {
              private static String DB_NAME;
              private static String DB_PATH = "/data/data/com.muthu.tamil/databases/";
              private final Context myContext;
              private SQLiteDatabase myDataBase;

             static
              {
                  DB_NAME = "aathichudi.db";
              }

  public DataBaseHelper(Context paramContext)
  {
    super(paramContext, DB_NAME, null, 1);
    DB_PATH = "/data/data/" + paramContext.getPackageName() + "/databases/";
    this.myContext = paramContext;
  }

  private boolean checkDataBase()
  {
    return new File(DB_PATH + DB_NAME).exists();
  }

  private void copyDataBase()
    throws IOException
  {
    InputStream localInputStream = this.myContext.getAssets().open(DB_NAME);
    FileOutputStream localFileOutputStream = new FileOutputStream(DB_PATH + DB_NAME);
    byte[] arrayOfByte = new byte[1024];
    while (true)
    {
      int i = localInputStream.read(arrayOfByte);
      if (i <= 0)
      {
        localFileOutputStream.flush();
        localFileOutputStream.close();
        localInputStream.close();
        return;
      }
      localFileOutputStream.write(arrayOfByte, 0, i);
    }
  }




  public void createDataBase()
    throws IOException
  {
    if (checkDataBase())
      new File(DB_PATH + DB_NAME).delete();
    getReadableDatabase();
    close();
    try
    {
      copyDataBase();
      return;
    }
    catch (IOException localIOException)
    {
    }
    throw new Error("Error copying database");
  }

  public Cursor getData(String paramString)
  {
    return this.myDataBase.rawQuery(paramString, null);
  }

  public void onCreate(SQLiteDatabase paramSQLiteDatabase)
  {
  }

  public void onUpgrade(SQLiteDatabase paramSQLiteDatabase, int paramInt1, int paramInt2)
  {
  }

  public void openDataBase()
    throws SQLException
  {
    this.myDataBase = SQLiteDatabase.openDatabase(DB_PATH + DB_NAME, null, 1);
  }

i write code for db connection in android but i get ERROE like this:

sqlite3_open_v2(“/data/data/com.muthu,tamil/databases/aathichudi.db”,
&handle, 1, NULL) failed
sqlite3_open_v2(“/data/data/com.muthu,tamil/databases/aathichudi.db”, &handle, 1, NULL) failed
sqlite returned: error code = 14, msg = cannot open file at source line 25467
sqlite3_open_v2(“/data/data//data/data/com.muthu.tamil/files/databases/aathichudi.db”, &handle, 1, NULL) failed
Shutting down VM
threadid=1: thread exiting with uncaught exception (group=0x4001d800)
FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.muthu.tamil/com.muthu.tamil.HomeActivity}: android.database.sqlite.SQLiteException: unable to open database file
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
at android.app.ActivityThread.access$2300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.database.sqlite.SQLiteException: unable to open database file
at android.database.sqlite.SQLiteDatabase.dbopen(Native Method)
at android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:1812)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:817)
at com.muthu.tamil.sql.DataBaseHelper.openDataBase(DataBaseHelper.java:112)
at com.muthu.tamil.HomeActivity.onCreate(HomeActivity.java:41)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
… 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-09T23:18:06+00:00Added an answer on June 9, 2026 at 11:18 pm
    sqlite3_open_v2("/data/data/com.muthu,tamil/databases/aathichudi.db", &handle, 1, NULL)
    failed sqlite returned: error code = 14, msg = cannot open file at source line 25467 
    

    This error is produced only when your database is not created in the emulator or the device. You can check whether your database is created in your IDE DDMS/file_explorer (/data/data/Ur_pkg_name/databases/ur_db_name).

    There was a bug reported related to this problem: http://code.google.com/p/android/issues/detail?id=949

    I have come across with several solutions/workarounds people came up with including the followings:

    If you are using sharedUserId in your Manifest file changing the sharedUserId of an application and re-installing the application could work since it does not have the required ownership to write to the SQLite database.

    Editing the manifest file can eliminate the mistake again. Inside the manifest, make sure that you’ve entered the correct min sdk version. You could make sure your min SDK version is OK by checking manifest file if there is an exclamation indicator across the left column from the code telling me of your mistake.

    I hope one of these solutions work for you too.

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

Sidebar

Related Questions

I have code like this: public class DatabaseHelper extends SQLiteOpenHelper { private static final
I have a database helper class private static class DatabaseHelper extends SQLiteOpenHelper{ DatabaseHelper(Context context){
public class A { private A(int param1, String param2) {} public static A createFromCursor(Cursor
public class Test { public static void main(String[] args) { DemoAbstractClass abstractClass = new
public class DBAdapter { public static final String COLUMN_ID = ID; public static final
public class tryAnimActivity extends Activity { /** * The thread to process splash screen
public class MyClass { public string MyProperty{ get; set; } Now, I would like
public class Knowing { static final long tooth = 343L; static long doIT(long tooth)
public class HttpPostTask extends AsyncTask<Void, Integer, Void> { TextView txtStatus = (TextView)findViewById(R.id.txtStatus); @Override protected
I have a DatabaseHelper class and DatabaseAdapter class. When i try to select data

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.