This is a mysql-jdbc question. I am trying to issues a jdbc statement to add a row into the mysql table named ‘registration’. There are three columns in the table. The last one is a timestamp.
The following is the jdbc statement in my java code:
With this statement, the timestamp in the table is always set to ‘0000000000’. I know the problem is related to how to format now() in a right way, I have tried “now()”, ‘now()’, and now(), and none of them work.
I’m not sure what context this ps is being used in, but I want something similar for the default value to be generated when a new row is inserted into the database.
The solution you have given will probably work but it goes against the MDA concept and isn’t round trip reversible.
How do I add a generated timestamp value for this field that is fully reversible and specify it from the model rather than the code?