I've saved date to msqlite. When I retrieve it, it gives me this string "Fri Jul 12 13:16:33 GMT+00:00 2019". But, I can't get to convert it to java.sql.Date
that I need...
Any help is appreciated
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);
tells me
GraphEntry (java.sql.Date,int) in GraphEntry cannot be applied to (java.lang.String, int)