Code example for SQLiteDatabase

Methods: execSQL

0
    private static final String CREATE_TABLE_DDL = "CREATE TABLE tiny(_id integer primary key autoincrement not null, name VARCHAR);\n";
    private static final String DROP_TABLE_DDL = "DROP TABLE IF EXISTS tiny";
 
    @Override 
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(CREATE_TABLE_DDL);
    } 
 
    @Override 
    public void onUpgrade(SQLiteDatabase db,
                          int oldVersion,
                          int newVersion) {
        db.execSQL(DROP_TABLE_DDL);
        onCreate(db);
    } 
 
}