我在 sqlite 中创建了一个表,这里给了我java.lang.ArrayIndexOutOfBoundsException 代码:
db.execSQL("CREATE TABLE "+scoreboardTable+" ("+scoreboard_id+ " INTEGER PRIMARY KEY NOT NULL,"+" FOREIGN KEY ( "+player_fk+ ") REFERENCES "+playerTable+" ("+playerid+ "), "
+"FOREIGN KEY ( "+ Template_fk+ ") REFERENCES " +TemplateTable+" ("+ templateid+ "),"+ total_flick+"int"+surprise_success+"varchar"+surprise_failure+"varchar)");
}
和
public void Insert_scoreboard(String[] str)
{
try
{
SQLiteDatabase DB= this.getWritableDatabase();
ContentValues cv=new ContentValues();
cv.put("scoreboard_id", str[0]);
cv.put("player_fk", str[1]);
cv.put("Template_fk", str[2]);
cv.put("total_flick", str[3]);
cv.put("surprise_success", str[4]);
cv.put("surprise_failure", str[5]);
DB.insert( scoreboardTable , "scoreboard", cv);
DB.close();
}
catch(Exception ex)
{
ex.toString();
}
我在哪里做错了。