Open fredericoregateiro opened 6 years ago
The only way i was able to accomplish this was to create a formater and use the format as a parameter:
SimpleDateFormat dateTimeformatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
PreparedStatement stmt = connection.prepareStatement(query);
stmt.setObject(1, dateTimeformatter.format(date), java.sql.Types.DATE);
and with sqlo like this:
transaction.createQuery(query)
.addParameter("SystemEntryDate", dateTimeformatter.format(document.getSystemEntryDate()))
.executeUpdate()
Is there a better way?
It is possible to save da Date property like a date on a database instead of a timestamp? In my class i have:
and the database i have to use is a existing sqlite3 db, containing the values on the SystemEntryDate column like 2018-10-23 10:16:27.8871829
and the values stored in this column by sql2o is a timestamp like 1540306987843.
Can i change this behavior, and store a date?