안녕하세요. 안드로이드 SQLite를 이용해보려는데, 오류가 계속 나네요.
오류를 해결하기위해 안드로이드 sqlite 쿼리문에 대해 공부도 하고 했는데..당최 해결할수 가 없네요 ㅠㅠ
public class MySQLiteOpenHelper extends SQLiteOpenHelper{
public MySQLiteOpenHelper(Context context, String name,
CursorFactory factory, int version) {
super(context, name, factory, version);
}
@Override
public void onCreate(SQLiteDatabase db) {
String sql="create table proset (" +"_id integer primary key autoincrement, "+ "pronum text, "+ "sequ text, "+"check integer);";
db.execSQL(sql);
/*
String DATABASE_TABLE="proset";
String KEY_ROWID="pro";
String KEY_NAME="pronum";
String KEY_ORDER="sequ";
String KEY_CHECK="check";
db.execSQL("CREATE TABLE " + DATABASE_TABLE + " (" +
KEY_ROWID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
KEY_NAME + " TEXT NOT NULL, " +
KEY_ORDER + " TEXT NOT NULL, " +
KEY_CHECK + " INTEGER);"
);
*/
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
String sql="drop table if exists proset";
db.execSQL(sql);
onCreate(db);
}
}
코드는 다음과 같구요
에로로그는 다음과 같습니다.
