I have sqlite database
private static final String DB_PROCESS_CREATE = "create table "
+ DB_TABLE_PROCESS + "(" + PROCESS_ID
+ " integer primary key autoincrement, "
+ PROCESS_DATE + " date);";
I create it `db.execSQL(DB_PROCESS_CREATE);
How to add date value in this datebase? I tried :
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));
But then I get error "The method put(String, String) in the type ContentValues is not applicable for the arguments (String, Date)".
.
stackoverflow.comm
No comments:
Post a Comment