我有sqlite database
private static final String DB_PROCESS_CREATE = "create table "
+ DB_TABLE_PROCESS + "(" + PROCESS_ID
+ " integer primary key autoincrement, "
+ PROCESS_DATE + " date);";
我创造它db.execSQL(DB_PROCESS_CREATE);
如何在此数据库中添加日期值?我试过 :
String date = new SimpleDateFormat("yyyy.MM.dd").format(Calendar
.getInstance().getTime());
ContentValues cv = new ContentValues();
cv.put(db.PROCESS_DATE,Date.valueOf(date));
db.mDB.insert(db.DB_TABLE_PROCESS, null, cv));
但后来我得到error
:
"The method put(String, String) in the type ContentValues is not applicable for the arguments (String, Date)".