We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It is possible to save da Date property like a date on a database instead of a timestamp? In my class i have:
private Date systemEntryDate; public Date getSystemEntryDate() { return systemEntryDate; } public void setSystemEntryDate(Date systemEntryDate) { this.systemEntryDate = systemEntryDate; }
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?
The text was updated successfully, but these errors were encountered:
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?
Sorry, something went wrong.
No branches or pull requests
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?
The text was updated successfully, but these errors were encountered: