Code example for SQLiteDatabase

Methods: beginTransactionendTransactionexecSQLsetTransactionSuccessful

0
  } 
 
  @Override 
  public void onCreate(SQLiteDatabase db) {
    try { 
      db.beginTransaction();
      db.execSQL("CREATE TABLE notes (position INTEGER PRIMARY KEY, prose TEXT);");
      db.setTransactionSuccessful();
    } 
    finally { 
      db.endTransaction();
    } 
  } 
 
  @Override 
  public void onUpgrade(SQLiteDatabase db, int oldVersion,
                        int newVersion) {
    throw new RuntimeException(
                               ctxt.getString(R.string.on_upgrade_error));
  } 
Stop searching for code, let great code find you!  Add Codota to your java IDE