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:
PreparedStatement pstmt = con.prepareStatement(
“insert into registration(username, password, timestamp) values (?, ?, ?)”);
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.
Could any one advice how to make this right?
Thanks in advance,