我是初学者。我学习SQLite
。我不懂函数 db.execSQL (DATABASE_CREATE)
;
private static final String DATABASE_CREATE = "create table users (_id integer primary key autoincrement, " + "name text not null);";
所以函数db.execSQL()
。怎么说的?请帮我。谢,
答案 0 :(得分:8)
来自SQLiteDatabase
的{{3}}:
execSQL(String sql): Execute a single SQL statement that is NOT a SELECT or any other SQL statement that returns data.
在您的示例中,要创建表,您将调用db.execSQL(DATABASE_CREATE)
,它将在您的应用程序的SQLite数据库上执行表create语句。