我已将日期保存到msqlite。当我检索到它时,它会给我这个字符串“ 星期五7月12日13:16:33 GMT + 00:00 2019 ”。但是,我无法将其转换为我需要的java.sql.Date
...
感谢您的帮助
SQLiteDatabase db = this.getReadableDatabase();
ArrayList<GraphEntry> result = new ArrayList<GraphEntry>();
Cursor cursor = db.rawQuery("SELECT * FROM graph_table", null);
if (cursor.moveToFirst()){
do {
String date = cursor.getString(cursor.getColumnIndex("date"));
int poid = cursor.getInt(cursor.getColumnIndex("poid"));
Log.d("date before", date);
GraphEntry graphEntry = new GraphEntry(date, poid);
result.add(graphEntry);
} while(cursor.moveToNext());
}
cursor.close();
db.close();
return result;
GraphEntry graphEntry = new GraphEntry(date, poid);
告诉我
GraphEntry中的GraphEntry(java.sql.Date,int)无法应用于 (java.lang.String,int)