I am trying to create a database that called rawData. The db will hava a column for the id, a foreign user id (_id from another table), data and finally a timestamp.
This is a running example of DAO with SQlite and Date in Java:
First create column MY_DATE TIMESTAMP in your TABLE and populate like this:
PreparedStatement st = connection.prepareStatement("INSERT INTO ......");
st.setDate(1, new java.sql.Date(lettura.getData().getTime()));
And to retrieve data first i get date in String type:
String dateStr = rs.getString(1);
Date myDate = new java.util.Date(Long.parseLong(dateStr));