Hi all i have a problem in a insert query.
I get datetime from java with:
SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date now = new Date();
String strDate = sdfDate.format(now);
p.s: I have try a sysout on strDate and it is correct.
I read a question, like that, where to enter in MySQL datetime must make a query like this:
INSERT INTO tracks (in) VALUES (STR_TO_DATE( ? ,'%Y-%m-%d %r'))
Where '?' is the string containing the date, but it don' t work.
Can anyone help me?
UPDATE: MySQL Server 5.7