我有以下表結構的Android源碼更新失敗
public class DBConnectionTableTVShow {
public static final String SHOWID = "show_id";
public static final String SHOWNAME = "show_name";
public static final String SHOWSEASON = "season_name";
public static final String EPISODENAME = "episode_name";
public static final String EPISODESTATUS = "episode_status";
public static final String DBNAME = "entertainment_tracker";
public static final String DBTABLE = "tv_show";
public static final int VERSION = 1;
}
現在我想更新episode_status
我已經創建了下面的方法
public void updateEpisodeStatus(String showName, String seasonName, String episodeNo, String epStat) {
db.execSQL("UPDATE tv_show SET " +
"episode_status='"+epStat+"'"+
"WHERE show_name='"+showName+"' " +
"AND season_name='"+seasonName+"' " +
"AND episode_name='"+episodeNo+"'",
null);
}
當我嘗試用這種方法我出現錯誤:
java.lang.IllegalArgumentException: Empty bindArgs
如何解決這個問題?
使用http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html#update(java.lang.String,android.content.ContentValues,java.lang.String中,JAVA .lang.String []) – 2013-05-11 05:05:55