我有sqlite数据库
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));
但是我收到错误:
"The method put(String, String) in the type ContentValues is not applicable for the arguments (String, Date)".